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
imap_mail_move on POP3 mailbox
Outlook won't open .pptx attachment directly
Non-Dell motherboard upgrade for Dell XPS Generation 5 Case
Exchange 2007 mail relay
How do I add rows to a datagridview based upon a For Each statement in VS2008?
SAS 9.1 - Excel Import
Adding one cell to the bottom of a named range defined byan OFFSET
Creating a Dynamic Form from SQL database tables in ColdFusion
MAC Mail with Exchange 2007 Attachment Issue
Error message when replying, sending, openning email in OWA