![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| conversion of different timestamp to standard timestamp | dprakash | Shell Programming and Scripting | 2 | 04-14-2009 03:23 PM |
| Convert DD-MMM-YYYY to MM-DD-YYYY | nuthalapati | Shell Programming and Scripting | 2 | 04-06-2009 04:25 PM |
| converting the date field from dd/mm/yyyy to yyyy/mm/dd | pareshan | Shell Programming and Scripting | 4 | 03-17-2009 05:43 PM |
| sort file on timestamp and a alphabetic code in it | harshada | UNIX for Dummies Questions & Answers | 5 | 10-03-2008 10:35 AM |
| Change Date from dd-mmm-yyyy to mm/dd/yyyy | stringzz | Shell Programming and Scripting | 9 | 09-15-2008 11:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sort for timestamp information-YYYY-MM-DD HH:MM:SS
Dear all,
Please advice how do I sort a file based on timestamp information. I want to sort the second column in asc/desc order which has timestamp information in format YYYY-MM-DD HH:MM:SS Example File - Input.txt contains cat ss.txt 100|2009-03-30 11:38:43 141|2009-06-01 12:12:01 200|2009-06-01 12:10:01 200|2009-06-01 12:11:01 When i run command below, I get result as sort -t'|' -k2,n Input.txt 100|2009-03-30 11:38:43 141|2009-06-01 12:12:01 200|2009-06-01 12:10:01 200|2009-06-01 12:11:01 But the correct expected output [ which means HH:MM:SS part should also be sorted] is 100|2009-03-30 11:38:43 141|2009-06-01 12:10:01 200|2009-06-01 12:11:01 200|2009-06-01 12:12:01 How do I get this expected output, please advice Regards, SUresh |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|