| Junior Member with 2 posts. THREAD STARTER | | Join Date: Mar 2010 Experience: Advanced | |
Finding first file name in dir I have a directory with several files in it that look alike except for the date that's part of the filename. Like this:
text_file_2010-03-01.txt
text_file_2010-02-28.txt
text_file_2010-03-02.txt
text_file_2010-02-27.txt
text_file_2010-02-24.txt
text_file_2010-02-02.txt
text_file_2010-02-21.txt
text_file_2010-02-08.txt
In effect, I want to sort these in decreasing order and return the top filename. So they'd be sorted like this:
text_file_2010-03-02.txt
text_file_2010-03-01.txt
text_file_2010-02-28.txt
text_file_2010-02-27.txt
text_file_2010-02-24.txt
text_file_2010-02-21.txt
text_file_2010-02-08.txt
text_file_2010-02-02.txt
and only the file name "text_file_2010-03-02.txt" would be returned, which I would then use for other processing.
any ideas? |