Right, looking at your updated post there are still a few imponderables.

Is the start of record tag the literal caret followed by uppercase L or are we seeing a representation of a <control-L>?

Because of line-wrap it is difficult to tell what lines your header data is on. It looks like name, address and country/ZIP are on lines 3, 4 and 5 but are you certain that the address will always fit this pattern? What characters are you likely to find and have to allow for in the data? It looks like you have a/c no. on lines 6 and 8; are the lines identical and what is the format of the number? Did you mean end-period-date rather than end-period-value? What is the date format?

Most importantly, is that all of the data you wish to extract from the header? What widths are you going to lay down for each field? By specifying fixed length records you imply that there will be no field separators in your header file; is this what you want or do you want separators to aid legibility?

As for the proposed output files, it looks like you intend to have a single header file containing a line of fixed-width data for each customer plus a file of variable length data for each customer. How do you intend to associate the header info with the relevant data file? I assume that a/c no. would be unique so that could form part of the data file name.

Answering these questions may help you towards a solution and help us to help you.

Cheers,

JohnGG


In reply to Re: File read and re-ordering by johngg
in thread File read and re-ordering by KarmicGrief

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.