- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Sort problem
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
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
тАО03-02-2009 11:42 AM
тАО03-02-2009 11:42 AM
Re: Sort problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2009 11:51 AM
тАО03-02-2009 11:51 AM
Re: Sort problem
It's called COBOL. :-)
Except the numbers must be right justified in their fields. Of course the input procedure could fix them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2009 11:52 AM
тАО03-02-2009 11:52 AM
Re: Sort problem
sort -t# -k1.10n,1.19n file.text > test.sorted
should work, while:
sort -t# -k1.10n,1.19n -o test.sorted file.txt
*might* work...
what happens when you run either of those exactly as shown?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2009 11:58 AM
тАО03-02-2009 11:58 AM
Re: Sort problem
1124688 Barrera
1998945 Warble
2327703 Rebholz
8 5032 Rebholz
Result for ( sort -t# -k1.10n,1.19n -o test.sorted ground.txt2 ):
1124688 Barrera
1998945 Warble
2327703 Rebholz
8 5032 Rebholz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2009 12:06 PM
тАО03-02-2009 12:06 PM
Re: Sort problem
> Dennis: It's called COBOL. :-)
Except the numbers must be right justified in their fields. Of course the input procedure could fix them.
And its what COBOL would call an input procedure that I used when I manufactured the temporary fixed-position sort key. The output procedure stripped it.
The use of '-o output' file doesn't matter in HP-UX. In AIX, this simple form WORKS (even without the '-t#'):
# sort -k1.10n,1.19n file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2009 05:04 PM
тАО03-02-2009 05:04 PM
Re: Sort problem
Ah, right. The first field obviously starts in column 1.
This appears to be a bug. It is stripping leading blanks BEFORE it looks at column 10. This is why that "8" is making it work.
maberg: Please contact the Response Center and file a bug report.
- « Previous
- Next »