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 Configure VLAN on Intel Pro 1000 MT
Is this html markup flexible enough to accomodate various designs?
WDS deployment of Windows 7
Adding a second Cisco Voice Gateway Router to Cisco Unifiied Communications Manager 7.0.1
Dealing with Corrupted System Files on Vista
Trouble getting Reader Field to update to new Role
Sonicwall TZ210
Cloning
Accessing an FTP server internally that is on a different subnet.
dispersion module on visual net