I am reading in a series of .csv files which are in the form of:
ImageData_999.csv
ImageData_1000.csv
As you can see the number increase sequentially but they do not have leading zeros and so when they get read in I am currently looking at a list that ends like this:
ImageData_3259
ImageData_3289
ImageData_811
ImageData_907
The files do skip around in number so there won't be 3289 files if that is the largest file name but I want to sort them so that they are properly ordered. That is what is below instead of what is above:
ImageData_811
ImageData_907
ImageData_3259
ImageData_3289
I am working in python and currently just getting the file names from the os module like so:
for root, dirs, files in os.walk(path):
for file in fnmatch.filter(files, filter):
yield os.path.join(root, file)
I have tried a few methods to sort the list that this produces but none of them seem to change the order.