Link to home
Start Free TrialLog in
Avatar of josephdts
josephdts

asked on

sorting file names

I have a number of files in a directory folder of the type
query.log.19-Aug-13-10.39.32.txt
query.log.19-Aug-13-11.29.36.txt
As you can see, there is a date/time stamp in the names.
I want to write a small executable that will sort these files by the data/time stamps.
Thanks
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I would use the ISO format of "2013-08-13T10:39:32" because it works in alpha-numeric sort order without an external program.
And another thought.  If you are viewing this file list in Windows Explorer, it will sort the names in it's own odd way no matter what the 'order' in the directory is.
Avatar of josephdts
josephdts

ASKER

I cannot use ISO format. This is how these files appear.
I would like the output of the executable to be a text file with the names in the correct order.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
worked for me