in reply to •Re: Reformat Text File
in thread Reformat Text File
my %result; my @keys; while (<>) { chomp; my ($k, $v) = split /,/; push @keys,$k if (!exists $result{$k}); push @{$result{$k}}, $v; } for (@keys) { print join(",", $_, @{$result{$_}}), "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Reformat Text File
by gaal (Parson) on Oct 05, 2004 at 16:37 UTC | |
by ikegami (Patriarch) on Oct 05, 2004 at 17:36 UTC | |
by tall_man (Parson) on Oct 05, 2004 at 20:17 UTC |