locked
Why are foldernames sorted and displayed alphabetically, but filenames not sorted and displayed alphabetically? RRS feed

  • Question

  • Windows 7                                                 Windows Vista

    Folders         Text Documents                      Folders        Text Documents

    a                  a 2                                        a                 a

    a 2               a                                           a 2              a 2

    a2                a2                                         a2               a2

    CORRECT     INCORRECT                           CORRECT    CORRECT

     

    The only solution I found is to manually (I repeat, "MANUALLY!!") add a " " (SPACE) after the filename, before the .extension to EACH AND EVERY filename affected, resulting in a true alphabetical sort and display order.  I might add that I learned the alphabet and how it works well before I was enrolled in grade one.  I can't believe that an operating system which is capable of doing so much cannot perform even the most basic of all tasks properly.  I understand ASCII and that a " " (SPACE) is assigned a value, but why didn't this happen in Vista or XP and why doesn't it apply to folders as well?  And why isn't there a one-time fix that will just force the computer to resolve the issue automatically, instead of forcing me to use my time and add a space to every darn filename one at a time?!!!!  Could someone please solve this seemingly complicated issue.  I might add that I found the following "solution" which doesn't solve anything:

    1.  Click the Start orb.
    2.  Enter group policy in the search box.
    3.  When Edit Group Policy comes up, click it.
    4.  Navigate to Computer Configuration > A dministrative Templates > Windows Components > Windows Explorer .
    5.  Right click the Turn off numerical sorting in Windows Explorer entry.
    6.  Change the state to Enabled .

    It will make a file called 1111.txt appear before 222.txt which, as I know how to count, is incorrect.  222 occurs 889 numbers before 1111.  I'm sorry, but turning off numerical sorting doesn't fix anything.

     

     

    Thursday, July 22, 2010 4:41 PM

Answers

  • You'd have seen it was answered in the other thread if you'd read it more carefully.

    Microsoft is sorting the entire name, including the part you can't see (i.e., the period and file extension are hidden with default Windows settings). 

    Thus the sort algorithm is REALLY seeing and sorting these strings:

    a 2.txt
    a.txt
    a2.txt

    Note carefully that the second character (space, period, '2') defines the sort order.  Space is code 32, period is 46, and '2' is 50 in ASCII and Windows 1252 Unicode.

    Directories do not have file extensions, and thus the period is likely being left off internally, so what you see is all that is being sorted.

    There is no good workaround for this.

    A wise man once said "Make everything as simple as possible but no simpler."  That applies in this case as whomever (re)coded the sort algorithm clearly just didn't think about this.

    -Noel

    • Marked as answer by Magon Liu Friday, July 30, 2010 11:14 AM
    Thursday, July 22, 2010 7:14 PM