Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-30-2006, 08:16 AM   #16
Registered: Mar 2004
Posts: 35

Original Poster
Rep: Reputation: 15

Sorry for the confusion. I kept overlooking the flag for some reason. Some days, judging by the stupid mistakes I make I think I should have stayed in bed.
Thanks again for everyone's help.
Old 08-30-2006, 02:43 PM   #17
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Originally Posted by schneidz
um, i might just be showing my ignorance but how about some combination of
sort | uniq
Has the same efect as sort -u but requires two processes...

Old 08-30-2006, 07:21 PM   #18
Registered: Jul 2004
Location: Chennai, India
Posts: 942

Rep: Reputation: 216Reputation: 216Reputation: 216
Oops sorry, my last post was incomplete.

If the input data was:
foo,foo bar,foobar,blah,123,boo,boo bar,boobar
foo,foo bar,foobar,blah,345,boo,boo bar,boobar
foo,foo bar,foobar,halb,345,boo,boo bar,boobar
foo,foo bar,foobar,blah,234,boo,boo bar,boobar
foo,foo bar,foobar,blah,345,oob,boo bar,boobar and so on.
foo,foo bar,foobar,blah,234,boo,boo bar,boobar

ie. if the key were the same but other fields differed.

My understanding of uniq is that it looks at the full record and not just the sort key. So as per my understanding there would 3 distinct records for code 345. So I thought that the sorted output had to be piped to `awk`. (I don't have acces to a unix machine right now and so can't check it out).



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
....How to use awk to sort.... nisson Linux - General 12 11-02-2012 03:51 PM
Sed and Awk Gins Programming 7 04-19-2006 10:32 AM
how to delete duplicates entries in xml file using sed/awk/sort ? catzilla Linux - Software 1 10-28-2005 02:57 PM
How to loop or sort in bash, awk or sed? j4r0d Programming 1 09-09-2004 03:22 AM
awk/sed help pantera Programming 1 05-13-2004 11:59 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration