perl -ne 'chomp; $hash{$1}.=$2."," if /^([^\|]+\|[^\|]+)\|([^\|]+)$/; +END{chop$hash{$_} foreach keys %hash; print "$_|$hash{$_}\n" foreach +keys %hash}' file_name
In reply to Re: amalgamate similar lines
by smokemachine
in thread amalgamate similar lines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |