Dark-Cracker
21st August 2004, 00:52
hum i hope this question doesn't sound too silly :) but i fact i am asking myself if there is an algo to sort the filename.
for example if u have the file :
toto1.txt toto2.txt toto10.txt toto20.txt
a genetical sort funtion will sort them like this :
toto1.txt / toto10.txt / toto2.txt / toto20.txt
of course if u use the ascii code to compare them it will have some problems if instead of toto1.txt u have toto01.txt
so my question is : there is an algo to sort ascendent filename whith numeric part ?
Bye.
for example if u have the file :
toto1.txt toto2.txt toto10.txt toto20.txt
a genetical sort funtion will sort them like this :
toto1.txt / toto10.txt / toto2.txt / toto20.txt
of course if u use the ascii code to compare them it will have some problems if instead of toto1.txt u have toto01.txt
so my question is : there is an algo to sort ascendent filename whith numeric part ?
Bye.