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
Monitor CIsco 6500 Switch Fabric and Backplane Utilization
Looking for Video Recording Software for Samsung Cameras
esx 4 update 01 no 64bit server will install
Trojan After Shock Keeps Opening Mutliple Tabs when using IE and Firefox, how to fix?
Email keeps going into Junk Mail Folder in Outlook 2003 on Exchange 2003
Big DNS problem, some internet servers reporting non-existent domain
Queries inside a while loop
How do I embed ajax calendar extender in asp.net gridview correctly?
C++ permutation with replacement algorithm
bootable usb