I'm an old Assembler and COBOL programmer. I have need to write some flat file conversion programs. I'll be reading one 7KB record at a time and parsing it into multiple records to be written, along with reformatting a few fields and generating a few more.

Just on what I have described here, do ou think perl is a good tool for the job?

Thanks.

Update

I need to write some conversion programs that: * Read a large record, about 7KB * Parse the data into multiple record formats and write them out * Generate record type fields 'a '1' record is patient info, a '2' is lab sample data, a '3' is diagnosis information.. at the end of each record is a 0 or a 1 indicating whether or not it is the last one of its type for this patient, so I have to keep track of where I am in the record arrays and whether or not I have a new patient in a record or a new test for the same one) * Reformat several data fields, usually stripping out some characters. My question to all of you would have to be is perl a good choice for this type of activity? It woudl be a perfect application for a COBOL program, but this facility has no COBOL compiler. Thanks

Material from duplicate node added as update and formating added by GrandFather


In reply to New to PERL - file format conversions to do by Mikhailoh

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.