in reply to New to PERL - file format conversions to do

Given that you're dealing with 7KB records, I'm guessing that there are quite a few fields packed in there. I would probably use Parse-FixedLength for the job, but then, I'm biased, since I (re)wrote the module :-) And, to be balanced, there are alternatives mentioned in the docs (and in future updates I may also mention Parse-Binary and Parse-Binary-Iterative), and I do confess mention that this and other similar modules are just glorified substitutes for the perl built-in functions pack and unpack.

Update: Since you want to flag the last record for each patient/record-type (if I read that correctly), you will have to decide whether you want to keep records in memory (if there aren't too many records or distinct patient/record-types), or load the data into a database (even a lightweight database like DB_File or DBD::SQLite might be appropriate) and sort by patient/record-type/record-number(desc) to easily "flag" each "last" record. But know that (as already mentioned) perl is perfect for the job, and it would be best if you would start writing sample code and ask for help with specific problem areas (rather than me guessing at what you might have problems with, and which approach to take :-).

  • Comment on Re: New to PERL - file format conversions to do