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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grouping and grep only different lines

Status
Not open for further replies.

babeo

Technical User
Joined
Mar 30, 2000
Messages
398
Location
CA
Hi,
I have a file contain repeating data, eg
[3311111450]
[3311111450]
[40222221100]
[40222221100]
[40222221100]
[66666221100]
[66666221100] and so on..

I want to cat the file but only display 1 line for each group
[3311111450]
[40222221100]
[66666221100] and so on.

Is there any command can do the grouping by line?
Thanks
 
Try this...

[tt]
sort file.dat | uniq
[/tt]
 
Woah Hooo!!

It works perfect. Thanks a lot Sam.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top