I have not sorted in awhile with the Unix sort command. I can't seem to get this file sorted by the date field or the 3rd item on each file line. Here is the file content:
0,0,1,6 9840 2006-09-30
0,0,9,7 9840 2006-09-26
0,1,7,13 9840 2006-09-26
0,1,8,16 9840 2006-09-26
0,1,9,12 9840 2006-09-26
0,1,10,12 9840 2006-10-04
0,1,10,13 9840 2006-10-04
0,1,10,15 9840 2006-09-26
0,2,10,15 9840 2006-09-26
0,2,10,16 9840 2006-09-26
0,3,9,8 IBM-LTO-2 2006-09-26
0,4,4,14 IBM-LTO-2 2006-09-26
0,4,5,17 IBM-LTO-3 2006-10-03
0,4,5,18 IBM-LTO-3 2006-10-03
0,4,5,19 IBM-LTO-3 2006-10-03
0,4,9,6 IBM-LTO-2 2006-09-26
I tried "sort +2n my.file > mysorted.file" but it didn't work. I tried several variations and differnt things and I am having no success sorting this file by the date field. Can anyone give me the syntax of the sort command that I need for this? Thanks for any help.
0,0,1,6 9840 2006-09-30
0,0,9,7 9840 2006-09-26
0,1,7,13 9840 2006-09-26
0,1,8,16 9840 2006-09-26
0,1,9,12 9840 2006-09-26
0,1,10,12 9840 2006-10-04
0,1,10,13 9840 2006-10-04
0,1,10,15 9840 2006-09-26
0,2,10,15 9840 2006-09-26
0,2,10,16 9840 2006-09-26
0,3,9,8 IBM-LTO-2 2006-09-26
0,4,4,14 IBM-LTO-2 2006-09-26
0,4,5,17 IBM-LTO-3 2006-10-03
0,4,5,18 IBM-LTO-3 2006-10-03
0,4,5,19 IBM-LTO-3 2006-10-03
0,4,9,6 IBM-LTO-2 2006-09-26
I tried "sort +2n my.file > mysorted.file" but it didn't work. I tried several variations and differnt things and I am having no success sorting this file by the date field. Can anyone give me the syntax of the sort command that I need for this? Thanks for any help.