Hi Guys,
I have a file to be sorted and uniq with the following format.
S00001002|01|20021231
S00001002|01|20011031
S00001006|01|20120430
S00001006|01|20111231
S00001006|01|20111031
S00001006|01|20110831
S00001006|01|20110731
S00001006|01|20101231
S00001006|01|20091231
S00001006|01|20081231
S00001006|01|20071231
S00001006|01|20071130
S00001006|01|20061231
S00001006|01|20061031
S00001006|01|20051231
S00001006|01|20011130
S00001006|01|20010731
S00001009|01|20010430
S00001023|01|20090430
The desired output is
S00001002|01|20021231
S00001006|01|20120430
S00001009|01|20010430
S00001023|01|20090430
I am trying to use the sort and uniq command for the first 13 characters.
sort -k 1,13 file1 | uniq > file2
Looks like I am missing something in the sort command here.Can you please help.