in reply to Re: How do I remove duplicate numeric elements of an array and preserve alphabetic elements? -- oneliner
in thread How do I remove duplicate numeric elements of an array and preserve alphabetic elements?

perl -F"," -lane "push @{$h{$F[0]}},$F[1]}{print map{$_.'|'.(join',',@{$h{$_}}).qq(\n)}keys %h" data.txt

This definitely works too.

June 8th 2018 Discipulus added code tags

  • Comment on Re^2: How do I remove duplicate numeric elements of an array and preserve alphabetic elements? -- oneliner
  • Download Code