Well, the way data munging works is you have two (possibly three) steps:
- Converting the data from a file to a usable data structure
- Maybe you do some comparisons to some other data structure
- Output the resultant data structure(s) to another file
The most important part here is the data structure you use. That will determine how you can think about your data and you can manipulate your data. It looks like you want to use some sort of hash of hashes and
foreach over the
keys. When you read it in, you're going to populate that hash. When you write it out, you're going to reference that hash.
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.