in reply to Parse file question
Read the file, line by line, and parse each line using Text::CSV, so that the line is saved as an array of fields
The second part of the problem is (a little) more tricky: you could easily detect which line is the first of a group with the same account number, but you want the last, and it is not so easy for you have not way to say "this is the last line for account 1234" until you actually read the next line. So you have to keep a buffer of the last two parsed lines: if account numbers differ, you take the last field of the first line. The only caveat is that you must consider the last line of the file, too
Careful with that hash Eugene.
|
|---|