- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Sort command has incorrect results or I don't know...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 04:29 AM
тАО08-21-2007 04:29 AM
they second field(date) and then the third
field (time), using the comma as the field
separator.
1,20051018,154700,67
2,20051018,142000,8
3,20051020,1111,67
4,20051020,222,8
Using cat txt | sort -t , -k2n -k3n
does not produce the correct results, (but
does on other OS's). It comes out like this:
4,20051020,222,8
3,20051020,1111,67
2,20051018,142000,8
1,20051018,154700,67
(The correct results should have the first
fields as 2,1,4,3)
I cannot seem to find
any parameters to get this to sort properly.
HP-UX B.11.11 U 9000/800
Solved! Go to Solution.
- Tags:
- Sort
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 04:37 AM
- Tags:
- evil cat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 04:38 AM
тАО08-21-2007 04:38 AM
Re: Sort command has incorrect results or I don't know what I'm doing
# cat infile
1,20051018,154700,67
2,20051018,142000,8
3,20051020,1111,67
4,20051020,222,8
# sort -t, -k2,2n -k3,3n infile
2,20051018,142000,8
1,20051018,154700,67
4,20051020,222,8
3,20051020,1111,67
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 04:41 AM
тАО08-21-2007 04:41 AM
Re: Sort command has incorrect results or I don't know what I'm doing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 04:44 AM
тАО08-21-2007 04:44 AM
Re: Sort command has incorrect results or I don't know what I'm doing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2007 07:54 PM
тАО09-07-2007 07:54 PM
Re: Sort command has incorrect results or I don't know what I'm doing
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
You should also close this thread indicating you have a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2007 01:41 AM
тАО09-10-2007 01:41 AM