in reply to amalgamate similar lines
while (<DATA>) { my ($onetwo,$three) = $_=~/(.*)\|(.*)/; push @{$hash{$onetwo}},$three; } for (sort keys %hash) { print $_."|",join ",",@{$hash{$_}}; print "\n"; } __DATA__ aaa|bbb|ccc ddd|eee|fff ddd|eee|xxxxx hhh|iiii|jjjjjj
--------------------------------------------------------------
"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".
|
|---|