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
How to Setup Airport Extreme as DHCP Server on LAN with SonicWall
Setting up a PC with Multiple Operating Systems (Windows 98 and Windows XP Pro)
SBS2003 no http access just https
Emphasize an out of range value in Excel.
Upgrade Sqlite in RHEL5.4
System.FormatException:Dat
agridviewC
omboboxcel
l value is not valid
How do I enable audio mapping over RDP on Windows 7?
OMA problem in Exchange 2010 - HTTP Error 500.24
SBS server 2003 VPN connection
Folders UNIDs and Duplicates