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
Java swing: AbstractButton
WebSphere Application Server Network Deployment
Oracle Join null rows.
Dell PowerEdge Perc 4e/Di RAID 1 expansion
Certain Email messages are shown in OWA but not in Outlook 2010
DHCP service failed to see a directory server
MySql injection hack
Outlook Contact Consolidation
How to Create Firebird Trigger to get AutoID by using Vb.net code
Send two files in email as attachment in unix shell scripting using ksh