I am sorry for the confusion. Lets say the actual file has 5 blocks as shown below(each end of block is distinguished by a record having its first character as '5'). Now, I will be dividing this actual file into 4 smaller files

Step 1: Go through the file, find the first record having the first character as '5' and copy until then to first file.

Step 2:Copy the next block until you get first character as '5' into second file and so on until the entire file is divided into 4 smaller files in round robin fashion

Actual File:
1this is block 1 2this is block 1 3this is block 1 4this is block 1 2this is block 1 3this is block 1 5this is block 1 1this is block 2 2this is block 2 3this is block 2 2this is block 2 3this is block 2 5this is block 2 1this is block 3 2this is block 3 5this is block 3 1this is block 4 2this is block 4 5this is block 4 1this is block 5 3this is block 5 5this is block 5
File1:
1this is block 1 2this is block 1 3this is block 1 4this is block 1 2this is block 1 3this is block 1 5this is block 1 1this is block 5 3this is block 5 5this is block 5
File 2:
1this is block 2 2this is block 2 3this is block 2 2this is block 2 3this is block 2 5this is block 2
File 3:
1this is block 3 2this is block 3 5this is block 3
File 4:
1this is block 4 2this is block 4 5this is block 4

In reply to Re^2: Splitting a Blocked file in Round Robin into smaller files by tradersjoe0
in thread Splitting a Blocked file in Round Robin into smaller files by tradersjoe0

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.