Thank you so much for your help, There is another question that I would like to know if I want to get out put with more details what should I do, cause In some part of my data I have similar coordinates which make problem with script they look like :
__DATA__ chr1 101 105 X X - chr1 101 105 X X - chr1 101 105 X X - chr1 101 105 X X - chr1 102 108 X X - chr1 106 111 X X - chr1 106 111 X X - chr1 112 113 X X - chr1 113 115 X X - chr2 114 118 X X - chr2 114 118 X X - chr2 114 118 X X - chr2 114 118 X X - chr2 119 121 X X - chr2 120 123 X X - chr3 125 130 X X - chr3 125 130 X X - chr3 131 132 X X - then I want to get output like this : output : ID_1 chr1 101 105 4 ID_1 chr1 102 106 1 ID_1 chr1 106 111 2 ID_2 chr1 112 113 1 ID_3 chr1 113 115 1 ID_1 chr2 114 118 1 ID_2 chr2 119 123 1 ID_2 chr2 119 123 1 ID_1 chr3 125 130 2 ID_2 chr3 131 132 1
which it counts the number of similar coordinates as well and show them individually instead of total counting by merging them.

In reply to Re^2: Counting problem! by g-alone
in thread Help the counting! by g-alone

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.