Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

leaving out lines with duplicate fields

Status
Not open for further replies.

arunrr

Programmer
Oct 2, 2009
103
US
In the file below, I need to leave out lines where the URL field (#6) is a duplicate.

Can't use "sort | uniq" as these are not exactly duplicate lines.

0 04:00 GMT 09:30 Local /indvsl2009/engine/match/430882.html India v Sri Lanka at Kanpur, 2nd Test - day 2
1 23:00 GMT 12:00 Local /nzvpak2009/engine/match/423778.html New Zealand v Pakistan at Dunedin, 1st Test - day 2
0 04:00 GMT 09:30 Local /indvsl2009/engine/match/430882.html India v Sri Lanka at Kanpur, 2nd Test - day 3
1 23:00 GMT 12:00 Local /nzvpak2009/engine/match/423778.html New Zealand v Pakistan at Dunedin, 1st Test - day 3
0 00:00 GMT 10:00 Local /ausvwi09/engine/match/406189.html Australia v West Indies at Brisbane, 1st Test - day 1

The output should be...

0 04:00 GMT 09:30 Local /indvsl2009/engine/match/430882.html India v Sri Lanka at Kanpur, 2nd Test - day 2
1 23:00 GMT 12:00 Local /nzvpak2009/engine/match/423778.html New Zealand v Pakistan at Dunedin, 1st Test - day 2
0 00:00 GMT 10:00 Local /ausvwi09/engine/match/406189.html Australia v West Indies at Brisbane, 1st Test - day 1

Thanks,
AR
 
sort -k 6,6 -u /path/to/input

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Arun, it's customary to give a little purple star if you receive a 'perfect' answer.

The internet - allowing those who don't know what they're talking about to have their say.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top