print only unique values
Hi All,
I have a one text file , in which I have duplicates values , which is starting as ORA- related. now , I need to print only values , which has uniq ora , irrespective of the entire line , whihc is uniq. Quote:
|
Sorry, uniq doesn't work that way. The entirety of each line is considered when using uniq.
I was wrong, Sorry. |
Code:
sort ./test.txt | uniq -w9 ---------- Post added 06-22-12 at 12:43 PM ---------- Habitual please stop posting info that is incorrect, twice today I caught you. The -w option can specify the number of characters to compare, in this case 9. |
Quote:
Now I know that -wN will ONLY count the first N as "unique". Thanks for that. Yeah, you "caught" me alright. Trying to help some people out. |
I'm not trying to flame you but I felt that if I didn't repost this guy would walk away thinking it's not possible and that's something we want to avoid. Thanks for trying to help out with community and welcome to LQ.
|
Quote:
http://www.bournetoraiseshell.com/ar...20622164348467 |
My wording could have been better as well in regards to your post. I think we can move on from this now Habitual.
Alok did the above code give you the solution you were looking for? |
Quote:
just curious to me , what w9 switch did here ?? |
-w tells uniq the number of characters to compare, by default it will compare the entire line. Since the only unique value you wanted to compare was the ORA number which is 9 characters long you specify the -w with the number 9.
|
All times are GMT -5. The time now is 11:11 PM. |