I have a list of files with a bunch of attributes. One of the attributes is the file name which is how I would like to sort the list. However, the list goes something like t
It is sorting correctly. The problem here is that the names aren't good to sort the way you want. In means of string, 10 comes before 2 and 21 comes before 5.
If you want it to sort it like it was numbers, you have 2 approaches:
1 - Change all your listings to add a leading 0 before numbers with just one digit.
2 - Do as William suggested, aplit the name, transform the string to integer and sort by it.
I would recommend option 1 since the second rely on the padronization of the names.