SOLVED

Sort by Name not proper for numbered files.

%3CLINGO-SUB%20id%3D%22lingo-sub-2804345%22%20slang%3D%22en-US%22%3ESort%20by%20Name%20not%20proper%20for%20numbered%20files.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2804345%22%20slang%3D%22en-US%22%3E%3CP%3EJust%20trying%20to%20understand%20the%20logic%20of%20OneDrive's%20%22Sort%20by%20Name%22%20when%20it%20comes%20to%20numbers.%20Take%20a%20look%20at%20the%20below.%20%229-26%22%20shouldn't%20be%20coming%20before%20%229-3%22.%20The%20number%2026%20should%20be%20perceived%20as%20after%203.%20I%20cannot%20honestly%20say%20I've%20seen%20that%20issue%20with%20other%20storage%20services.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22out_of_order.jpg%22%20style%3D%22width%3A%20137px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F314488iF46C669BB8E3A348%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22out_of_order.jpg%22%20alt%3D%22out_of_order.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2804345%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOneDrive%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Esort%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2804396%22%20slang%3D%22en-US%22%3ERe%3A%20Sort%20by%20Name%20not%20proper%20for%20numbered%20files.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2804396%22%20slang%3D%22en-US%22%3EIt%E2%80%99s%20by%20design.%20In%20order%20to%20fix%20it%20you%20have%20to%20put%20always%20ensure%20your%20number%20have%202%20digits.%3CBR%20%2F%3EEx.%202021-9-4%20should%20be%202021-09-04%20and%20then%20your%20file%20will%20have%20the%20proper%20order.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2804441%22%20slang%3D%22en-US%22%3ERe%3A%20Sort%20by%20Name%20not%20proper%20for%20numbered%20files.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2804441%22%20slang%3D%22en-US%22%3EThank%20you%2C%20I%20did%20consider%20that%20but%20I%20have%20thousands%20of%20files%20and%20will%20need%20to%20figure%20out%20a%20command%20line%20to%20change%20them%20all%20with%20variables%20involved.%20I%20thought%20I%20had%20resolved%20it%20at%20first%20with%20sorting%20by%20file%20creation%20date%20but%20that%20is%20not%20always%20accurate%20to%20the%20file%20contents%2C%20hence%20the%20name%20scheme.%3CBR%20%2F%3E%3CBR%20%2F%3EHopefully%20this%20is%20something%20the%20devs%20can%20reconsider.%3C%2FLINGO-BODY%3E
New Contributor

Just trying to understand the logic of OneDrive's "Sort by Name" when it comes to numbers. Take a look at the below. "9-26" shouldn't be coming before "9-3". The number 26 should be perceived as after 3. I cannot honestly say I've seen that issue with other storage services. 

out_of_order.jpg

3 Replies
best response confirmed by Drive1000 (New Contributor)
Solution
It’s by design. In order to fix it you have to put always ensure your number have 2 digits.
Ex. 2021-9-4 should be 2021-09-04 and then your file will have the proper order.
Thank you, I did consider that but I have thousands of files and will need to figure out a command line to change them all with variables involved. I thought I had resolved it at first with sorting by file creation date but that is not always accurate to the file contents, hence the name scheme.

Hopefully this is something the devs can reconsider.

@Drive1000 In your example, it's not necessarily clear that these are dates. Credit cards and other codes have a similar format numeric dashed format. To sort as you desire, use ISO 8601 date formatting with 2 digit months for unambiguous representation as recommended by most data management authorities.