i would write a parser for these files. represent the contents as a set
of hashes/arrays. if you have control over the format of the files, you
might want to make them simpler so that you won't have to write a real
parser.