hi. i'm writing a music database at work, just to see whether or not it will work. each week there are entries and deletions from the catalogue that come in the form of an update file. the update file has different types of records that will contain different information. the file is fixed length and delimited. the first 2 characters are the record type. a typical update file would look like this...

1-2 3-10 12-18

00 date headernumber

1-2 3-5 5~

01 label artist~title~style etc

the 00 record contains the header number which identifies what cd it is. a 00 record is ALWAYS followed by a different record type who's information would pertain to the preceding 00 record UNLESS the item is to be deleted. if the item is to be deleted it would have a 00 record on its own (which would then be followed by another 00 record which would contain information about a different cd, unless it was being deleted) and so on and so forth.

so what i think i need to do is read 2 lines at a time and if there are 2 00 records in a row, the first one is to be deleted. i'm not really sure how to go about reading in 2 lines at a time. does anyone have any ideas, or a better solution?

thanx in advance


In reply to fixed length records, reading lines and catalogue updates by Anonymous Monk

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.