in reply to Sort on Number Embedded in String
Pick the ISO 8601 Standard Date Format for any dates that must be human-readable and machine-readable. It reduces language problems (what is "September" in French?), and cultural problems (is "01/06/05" in January or June?).
Example: 2005-03-21.fwlog.gz
(You can put the date first, or the filename first, but I prefer date-first so that multiple filenames related to a given date will naturally sort together.)
Then all these things will sort properly. They will sort at the command line, they will sort in your GUI file managers, they will sort in your perl code, all without expensive and error-prone coding.
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sort on Number Embedded in String
by grinder (Bishop) on Mar 23, 2005 at 07:46 UTC |