thank you a lot,you are right!it is not so clear my explanation! so...the input file is composed by intervals of different lenght of piece of genes (the name is in the first column).I have to split these intervals in smaller intervals of 200, considering to "complete the gap" among the intervals. At the same time, the intervals have to be of 200 but the next start has to be 200+2. To make it easier.. this is an easier input file. The intervals I have to create is 10 input.txt gene1 chr1 10 25 gene1 chr1 46 99 gene1 chr1 103 190 gene2 chr4 50 63 gene2 chr4 90 110 output.txt gene1 chr1 10 20 gene1 chr1 22 53 gene1 chr1 55 65 gene1 chr1 67 77 gene1 chr1 79 89 gene1 chr1 91 99 gene2 chr4 50 60 gene2 chr4 62 99 gene2 chr4 101 110

In reply to Re: continuuos intervals by mesana
in thread continuuos intervals by mesana

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.