in reply to amalgamate similar lines

Untested:
my %info; while (<>) { my ($key, $value) = /([^|]*\|[^|]*)\|(.*)/; push @{$info{$key}}, $value; } while (my ($key, $value) = each %info) { local $" = ","; print "$key|@$value\n"; } __END__
Perl --((8:>*

Replies are listed 'Best First'.
Re^2: amalgamate similar lines
by ysth (Canon) on Jan 09, 2006 at 13:57 UTC
      Yes - I don't think the OP stated any requirements about the order. A required ordering is easily added without changing the gist of the solution.

      And I'm not going to speculate what the OP wants or not.

      Perl --((8:>*