in reply to Merging 2 Formatted Files

If the files are not big, you can do this (untested)
while(<FIRSTFILE>) { ($key, $rest) = split; $list{$key}= $rest; } while(<SECONDFILE>) { ($key, $rest) = split; $list{$key}.= " " .$rest; } for(sort keys %list) { print "$_\n"; }
This will give you all the info on each id in one hash line.

If the files are big, you can sort them (using unix' sort command) and then merge them (which is trivial to code). On a second pass you just pick all consecutive lines which have the same ID.