Member
Registered: Oct 2003
Location: UK
Posts: 52
Rep:
|
Getting only unique lines using grep..
Guys,
I have a file that is text, and comma delimited and is over 65536 lines. I want to run a grep command or awk or something that will look down the file and check the second column which is a specific date and just return the dates. Then I would like to have one date displayed for each no matter how many times it's in the file :-
e.g
4,070327,9,41,20,-1,-10,-250,001
4,070328,9,41,20,-1,-101,-800,001
4,070328,9,41,20,-1,-102,-800,001
7,070327,9,41,20,-1,-102,-800,001
7,070329,9,41,20,-1,-103,-800,001
4,070329,9,41,20,-1,-104,-800,001
7,070327,9,41,20,-1,-104,-800,001
4,070328,9,41,20,-1,-106,-800,001
7,070326,41,20,-1,-106,-800,001
4,070324,41,20,-1,-112,-800,001
4,070227,20,-1,-118,-400,001
4,070327,29,41,20,-1,-12,-200,001
4,070328,29,41,20,-1,-102,-800,001
7,070327,88,41,20,-1,-102,-800,001
7,070329,99,41,20,-1,-103,-800,001
4,070329,93,41,20,-1,-104,-800,001
7,070327,93,41,20,-1,-104,-800,001
4,070328,93,41,20,-1,-106,-800,001
7,070326,42,20,-1,-106,-800,001
4,070324,42,20,-1,-112,-800,001
4,070227,22,-1,-118,-400,001
4,070327,91,41,20,-1,-12,-200,001
etc...
So I would like to see 070227, 070326, 070327,070328, 070329 displayed like this :-
070227
070326
070327
070328
070329
Any help would be much appreciated.....
cheers....
|