Microsoft
Software
Hardware
Network
Question : using uniq command
I have a pipe delimited file with tens fields.
Two of the fields are patronnumber and cardnumber
I want to sort by cardnumber and then remove the first row of lines that duplicate the cardnumber. I was trying to do with the uniq command in Unix.
Any suggestions?
If it cannot be done with uniq, is there are perl script that will remove duplicates?
Answer : using uniq command
So it sounds like you want to keep the cardnumber with the largest patronnumber
perl -F'\|' -ne '$n{$F[1]}=$_ unless $n{$F[1]} && $n{$F[1]} > $_;END{ print values %n}' file
Random Solutions
truncate vs delete
Batch printing word document to non-default printer
3Com Switch Troubleshooting
How to hide a dummy date value.
Push not working on iphone with Exchange 2010...
GP error --> Key segment not found <-- within Customer Service Mgt
Using an additional domain controller when PDC crashes
Setting up of a Forest Trust
iPhone Data Recovery After iOS4 Upgrade
how to rename a file before saving it after uploading in c#