Why does tilde ('~') go before numeric digits in NTFS file names?












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.










share|improve this question

























  • How exactly are you displaying the filenames? Please edit the question and be specific.

    – DavidPostill
    Jan 9 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
    Jan 9 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
    Jan 10 at 10:01






  • 1





    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.

    – BeowulfNode42
    Jan 10 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
    Jan 10 at 15:16
















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.










share|improve this question

























  • How exactly are you displaying the filenames? Please edit the question and be specific.

    – DavidPostill
    Jan 9 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
    Jan 9 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
    Jan 10 at 10:01






  • 1





    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.

    – BeowulfNode42
    Jan 10 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
    Jan 10 at 15:16














0












0








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.










share|improve this question
















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.







windows ntfs unicode filenames






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 10 at 10:02







Semisonic

















asked Jan 9 at 13:33









SemisonicSemisonic

1011




1011













  • How exactly are you displaying the filenames? Please edit the question and be specific.

    – DavidPostill
    Jan 9 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
    Jan 9 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
    Jan 10 at 10:01






  • 1





    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.

    – BeowulfNode42
    Jan 10 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
    Jan 10 at 15:16



















  • How exactly are you displaying the filenames? Please edit the question and be specific.

    – DavidPostill
    Jan 9 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
    Jan 9 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
    Jan 10 at 10:01






  • 1





    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.

    – BeowulfNode42
    Jan 10 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
    Jan 10 at 15:16

















How exactly are you displaying the filenames? Please edit the question and be specific.

– DavidPostill
Jan 9 at 14:26





How exactly are you displaying the filenames? Please edit the question and be specific.

– DavidPostill
Jan 9 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
Jan 9 at 19:35





Sorting in Windows isn't always by numeric value of characters. In Windows explorer normal punctuation characters precede alphabetic. This includes the tilde.

– LMiller7
Jan 9 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
Jan 10 at 10:01





@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
Jan 10 at 10:01




1




1





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.

– BeowulfNode42
Jan 10 at 10:08





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.

– BeowulfNode42
Jan 10 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
Jan 10 at 15:16





@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
Jan 10 at 15:16










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1392293%2fwhy-does-tilde-go-before-numeric-digits-in-ntfs-file-names%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1392293%2fwhy-does-tilde-go-before-numeric-digits-in-ntfs-file-names%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to make a Squid Proxy server?

Is this a new Fibonacci Identity?

19世紀