How to remove duplicate (or more) values within a selected field in a file, keeping only one copy? ExempleInput file: A    1,2,3,45,1,8,2,3B    5,6,6,6,6,6,2,3,7Expected output:A    1,2,3,45,8B    5,6,2,3,7
Remove duplicates values within a field
awk
Another perl solution:perl -anle '                                                                        print $F[0] , join ,, grep {!$seen{$_}++} split ,,$F[1];                  %seen=();                                                                   ' fileA 1,2,3,45,8B 5,6,2,3,7