0

I have a folder structure in which the folder names start with numbers. After a while, some folders (or, rather, the info they contain) become "archived", and I don't want them to visually clutter the space of the parent folder.

My solution so far is to rename the folders (as non-intrusively as possible) so that the "archived" folders go to the end of the list. I decided to go with adding a tilde character (~) to the beginning of the folder names, expecting to see ~-prefixed folders below the number-prefixed ones when sorting by name in ascending order.

But, instead of something like

parent folder:
  123
  456
  789
  ~012

I see this:

parent folder:
  ~012
  123
  456
  789  

That's surprising, considering that NTFS uses Unicode for its file name characters, and tilde's Unicode value is higher than of the [0-9] characters, which should put it after in the lexicographic order.

What's the reason of the behavior I'm observing and how to I make ~-prefixed folders be sorted after the number-prefixed ones?

Edit: To display the folder contents, I mostly use FAR Manager. But so far its sorting by name looks the same as in Windows Explorer. So a solution that works for Windows Explorer would also work for FAR Manager.

5
  • How exactly are you displaying the filenames? Please edit the question and be specific.
    – DavidPostill
    Commented Jan 9, 2019 at 14:26
  • Sorting in Windows isn't always by numeric value of characters. In Windows explorer normal punctuation characters precede alphabetic. This includes the tilde.
    – LMiller7
    Commented Jan 9, 2019 at 19:35
  • @LMiller7 is there any formal description of the character ordering in Windows file names? So that I could possibly pick up a symbol that would actually precede the numeric digits.
    – Semisonic
    Commented Jan 10, 2019 at 10:01
  • 2
    Newer Windows also uses some sort of "smart" numbering detection. This is mostly so you don't get a sequence like 1, 10, 11, 12, 2, 3, 4, 5, 6, 7, 8, 9 but also seems to detect slight character misalignments and adjusts the sequence to match the numbers despite any character table ordering. Commented Jan 10, 2019 at 10:08
  • @Semisonic MSDN states only that punctuation characters precede alphabetic. Which ones they are I don't know. There are only a few ASCII characters above 'z' and I suspect they behave the same way. There are many characters in the extended ASCII range above 160 that would work. I am sure you can find one that is suitable and not too difficult to enter.
    – LMiller7
    Commented Jan 10, 2019 at 15:16

0

You must log in to answer this question.

Browse other questions tagged .