I need to sort a file on the date field. My dates are in the second field and ":" delimited, with the mm/dd/yy format.
I have tried the following code but it sorts only on the month :
cat data | sort -t \: +1 -n > temp
So if I have original dates:
09/28/03
07/04/04
09/29/03
05/06/06
The output is:
05/06/06
07/04/04
09/28/03
09/29/03
Please help.
I have tried the following code but it sorts only on the month :
cat data | sort -t \: +1 -n > temp
So if I have original dates:
09/28/03
07/04/04
09/29/03
05/06/06
The output is:
05/06/06
07/04/04
09/28/03
09/29/03
Please help.