HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Perl Sorting Question
Operating System - HP-UX
1825576
Members
1953
Online
109682
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
01-26-2004 11:48 PM
01-26-2004 11:48 PM
I am trying to do a sort on file access time of a directory on a Windows NT direcotry. I can get the atime and the file name, but when I do a sort it always defaults to an ASCII sort on the filename. How do I do a numeric sort on the atime field? Is there an easy way to sort numerically on a specific field in Perl?
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 11:51 PM
01-26-2004 11:51 PM
Solution
Outside of perl, it would be the option -n to the sort command. And if the time is not on the begin of the line but in column 2 it would become
sort -nk2
But I guess more info on how the list of data looks might help us to give you a algorithm to do what you want...
sort -nk2
But I guess more info on how the list of data looks might help us to give you a algorithm to do what you want...
Every problem has at least one solution. Only some solutions are harder to find.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 12:27 AM
01-27-2004 12:27 AM
Re: Perl Sorting Question
my @list = map { $_->[0] }
sort { $a->[1] <=> $b->[1] }
map { [ $_, (stat)[8] ] }
glob "*.html";
that's all
search doc's for swarzian transform
sort { $a <=> $b } ...
is sort ascending numerical. swap a and b for descending
Enjoy, Have FUN! H.Merijn
sort { $a->[1] <=> $b->[1] }
map { [ $_, (stat)[8] ] }
glob "*.html";
that's all
search doc's for swarzian transform
sort { $a <=> $b } ...
is sort ascending numerical. swap a and b for descending
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP