Another nice perl command line switch is -n. This builds the while(<>) loop for you. Example:
perl -i.bak -ne 'print unless $s{(split /\|/)[0]}++' infileNote: more of these can be found in perlrun.
In reply to Re^3: how to remove duplicate based on the first column value
by revdiablo
in thread how to remove duplicate based on the first column value
by tariqahsan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |