my %result; while (<>) { chomp; my ($k, $v) = split /,/; push @{$result{$k}}, $v; } for (sort keys %result) { print join(",", $_, @{$result{$_}}), "\n"; }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re: Reformat Text File
by merlyn
in thread Reformat Text File
by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |