What part is giving you trouble?
If I were writing this, I'd read a line, split on whitespace, and use the first two fields as keys of a hash of array references. If order matters, I'd keep another array for order of the hash keys (or maybe use something like Tie::IxHash).
Producing the right output is just a matter of a loop, a join, and a print.
In reply to Re: Combining flat file records
by chromatic
in thread Combining flat file records
by pglinx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |