Discussion:
Odd file sort order
Add Reply
pjp
2018-08-01 19:20:54 UTC
Reply
Permalink
Raw Message
I'm doing images of my various systems and collecting them on one hard
disk. I notice a very "wrong" sort ordering when viewing the files.

The names in question in the order the appear are

INTEL-FRONTROOM
INTELI5
INTEL-RECROOM
INTEL-SUNPORCH

Shouldn't the INTELI5 entry appear at the bottom of this collection.
Think ascii character "-" comes before any letters but I haven't
checked. Reversing sort order keeps the anamoly, just reversed.

It's as if the hyphen is stripped from the filename before sorting.
Displayed on both Home and Pro 32 & 64 bit.

Now why the hell would anyone do that???
J. P. Gilliver (John)
2018-08-01 20:15:00 UTC
Reply
Permalink
Raw Message
Post by pjp
I'm doing images of my various systems and collecting them on one hard
disk. I notice a very "wrong" sort ordering when viewing the files.
The names in question in the order the appear are
INTEL-FRONTROOM
INTELI5
INTEL-RECROOM
INTEL-SUNPORCH
Shouldn't the INTELI5 entry appear at the bottom of this collection.
Think ascii character "-" comes before any letters but I haven't
checked. Reversing sort order keeps the anamoly, just reversed.
It's as if the hyphen is stripped from the filename before sorting.
Displayed on both Home and Pro 32 & 64 bit.
Now why the hell would anyone do that???
Well, a _reason_ for doing it is that some entity may have a collection
of things sorted - part numbers, for example - that could be keyed in by
a variety of people, some of whom faithfully copy all punctuation, some
of whom ignore it, some of whom convert anything into a dash (or dot, or
underline, or ...); in order to sort/find such a list of entities, one
approach is to ignore all punctuation (and spaces).

Whether Windows (Explorer?) has such an ability - and whether it is
turned on by default, or even whether it _can_ be turned on or off - I
don't know.

There _is_ at least one other sort control option - called something
like "intelligent numbers". It came in with - I think - XP, and is on by
default, and knows about numbers. On the older systems (or if you turn
this off), the numbers 1 to 12 would be sorted as 1, 10, 11, 12, 2, .. 9
whereas with it on, they're sorted 1, 2, ... 9, 10, 11, 12. (Before
this, if you wanted such a set of filenames to sort properly, you had to
put a leading zero into the filenames - 01, ... 09, 10, 11, 12.)
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

One of my tricks as an armchair futurist is to "predict" things that are
already happening and watch people tell me it will never happen.
Scott Adams, 2015-3-9
pjp
2018-08-01 21:59:58 UTC
Reply
Permalink
Raw Message
Post by J. P. Gilliver (John)
Post by pjp
I'm doing images of my various systems and collecting them on one hard
disk. I notice a very "wrong" sort ordering when viewing the files.
The names in question in the order the appear are
INTEL-FRONTROOM
INTELI5
INTEL-RECROOM
INTEL-SUNPORCH
Shouldn't the INTELI5 entry appear at the bottom of this collection.
Think ascii character "-" comes before any letters but I haven't
checked. Reversing sort order keeps the anamoly, just reversed.
It's as if the hyphen is stripped from the filename before sorting.
Displayed on both Home and Pro 32 & 64 bit.
Now why the hell would anyone do that???
Well, a _reason_ for doing it is that some entity may have a collection
of things sorted - part numbers, for example - that could be keyed in by
a variety of people, some of whom faithfully copy all punctuation, some
of whom ignore it, some of whom convert anything into a dash (or dot, or
underline, or ...); in order to sort/find such a list of entities, one
approach is to ignore all punctuation (and spaces).
Whether Windows (Explorer?) has such an ability - and whether it is
turned on by default, or even whether it _can_ be turned on or off - I
don't know.
There _is_ at least one other sort control option - called something
like "intelligent numbers". It came in with - I think - XP, and is on by
default, and knows about numbers. On the older systems (or if you turn
this off), the numbers 1 to 12 would be sorted as 1, 10, 11, 12, 2, .. 9
whereas with it on, they're sorted 1, 2, ... 9, 10, 11, 12. (Before
this, if you wanted such a set of filenames to sort properly, you had to
put a leading zero into the filenames - 01, ... 09, 10, 11, 12.)
And I do put leading zero's in :)
VanguardLH
2018-08-01 21:47:40 UTC
Reply
Permalink
Raw Message
Post by pjp
I'm doing images of my various systems and collecting them on one hard
disk. I notice a very "wrong" sort ordering when viewing the files.
The names in question in the order the appear are
INTEL-FRONTROOM
INTELI5
INTEL-RECROOM
INTEL-SUNPORCH
Shouldn't the INTELI5 entry appear at the bottom of this collection.
Think ascii character "-" comes before any letters but I haven't
checked. Reversing sort order keeps the anamoly, just reversed.
It's as if the hyphen is stripped from the filename before sorting.
Displayed on both Home and Pro 32 & 64 bit.
Now why the hell would anyone do that???
Sorting WHAT? Windows Explorer? There are lots of file managers or
other file tools.

If using Windows Explorer, are you clicking on the Name column header to
sort on that column? You show what appear to be only the filenames, so
you have the filetype hidden. Configure Windows Explorer to show the
extension (filetype): Tools -> Folder Options -> View tab, disable the
"Hide extensions for known file types" option. Could be you are mixing
filetypes in your sort.
mick
2018-08-01 22:02:48 UTC
Reply
Permalink
Raw Message
Post by VanguardLH
Post by pjp
I'm doing images of my various systems and collecting them on one hard
disk. I notice a very "wrong" sort ordering when viewing the files.
The names in question in the order the appear are
INTEL-FRONTROOM
INTELI5
INTEL-RECROOM
INTEL-SUNPORCH
Shouldn't the INTELI5 entry appear at the bottom of this collection.
Think ascii character "-" comes before any letters but I haven't
checked. Reversing sort order keeps the anamoly, just reversed.
It's as if the hyphen is stripped from the filename before sorting.
Displayed on both Home and Pro 32 & 64 bit.
Now why the hell would anyone do that???
Sorting WHAT? Windows Explorer? There are lots of file managers or
other file tools.
If using Windows Explorer, are you clicking on the Name column header to
sort on that column? You show what appear to be only the filenames, so
you have the filetype hidden. Configure Windows Explorer to show the
extension (filetype): Tools -> Folder Options -> View tab, disable the
"Hide extensions for known file types" option. Could be you are mixing
filetypes in your sort.
No, it is not that, it is a windows explorer thing and there is nothing
to I can see to overcome it.
It also happens in win 10 as well.
Directory Opus sorts those files 'correctly' or how PJP would have
expected them to be sorted.
--
mick
pjp
2018-08-01 22:05:26 UTC
Reply
Permalink
Raw Message
Post by VanguardLH
Post by pjp
I'm doing images of my various systems and collecting them on one hard
disk. I notice a very "wrong" sort ordering when viewing the files.
The names in question in the order the appear are
INTEL-FRONTROOM
INTELI5
INTEL-RECROOM
INTEL-SUNPORCH
Shouldn't the INTELI5 entry appear at the bottom of this collection.
Think ascii character "-" comes before any letters but I haven't
checked. Reversing sort order keeps the anamoly, just reversed.
It's as if the hyphen is stripped from the filename before sorting.
Displayed on both Home and Pro 32 & 64 bit.
Now why the hell would anyone do that???
Sorting WHAT? Windows Explorer? There are lots of file managers or
other file tools.
If using Windows Explorer, are you clicking on the Name column header to
sort on that column? You show what appear to be only the filenames, so
you have the filetype hidden. Configure Windows Explorer to show the
extension (filetype): Tools -> Folder Options -> View tab, disable the
"Hide extensions for known file types" option. Could be you are mixing
filetypes in your sort.
No that's certainly not relevant seeing as I'm specifically talking
about folders here. The examples I gave are all image backups folders
made by Windows backup. In other words they are simply the names of the
various pcs and used as folder names, the image backup creates the
folders. There's nothing specifically special about any of them, just
have some files and folders inside them. Just seems so odd that the
hyphen for all intents and purposes doesn't seem to exist for the
sorting. It must get stripped out rather than even converted to a space
by the behaviour it exibits, e.g. INTEL-RECROOM becomes INTELRECROOM and
that's what it uses to do the sorting.

As I said very odd and not expected if nothing else.
Paul
2018-08-01 22:33:22 UTC
Reply
Permalink
Raw Message
Post by pjp
Post by VanguardLH
Post by pjp
I'm doing images of my various systems and collecting them on one hard
disk. I notice a very "wrong" sort ordering when viewing the files.
The names in question in the order the appear are
INTEL-FRONTROOM
INTELI5
INTEL-RECROOM
INTEL-SUNPORCH
Shouldn't the INTELI5 entry appear at the bottom of this collection.
Think ascii character "-" comes before any letters but I haven't
checked. Reversing sort order keeps the anamoly, just reversed.
It's as if the hyphen is stripped from the filename before sorting.
Displayed on both Home and Pro 32 & 64 bit.
Now why the hell would anyone do that???
Sorting WHAT? Windows Explorer? There are lots of file managers or
other file tools.
If using Windows Explorer, are you clicking on the Name column header to
sort on that column? You show what appear to be only the filenames, so
you have the filetype hidden. Configure Windows Explorer to show the
extension (filetype): Tools -> Folder Options -> View tab, disable the
"Hide extensions for known file types" option. Could be you are mixing
filetypes in your sort.
No that's certainly not relevant seeing as I'm specifically talking
about folders here. The examples I gave are all image backups folders
made by Windows backup. In other words they are simply the names of the
various pcs and used as folder names, the image backup creates the
folders. There's nothing specifically special about any of them, just
have some files and folders inside them. Just seems so odd that the
hyphen for all intents and purposes doesn't seem to exist for the
sorting. It must get stripped out rather than even converted to a space
by the behaviour it exibits, e.g. INTEL-RECROOM becomes INTELRECROOM and
that's what it uses to do the sorting.
As I said very odd and not expected if nothing else.
One complication, is whether sorting is set for

"canonical sort order"
"numeric sort order"

At the moment, I don't have a good reference for what
the names could be, or what I should be searching for.
This is a hint, that there is more than one sort order.

https://support.microsoft.com/en-ca/help/319827/the-sort-order-for-files-and-folders-whose-names-contain-numerals-is-d#!en-ca%2Fhelp%2F319827%2Fthe-sort-order-for-files-and-folders-whose-names-contain-numerals-is-d

*******

The other detail about explorer is:

1) You can sort ascending or descending via one criterion.
The choice may be saved between sessions (using the
appropriate View button perhaps).

2) Via some trickery, it's possible to set the sort
criteria to "none". But this setting is not remembered,
and if you custom arrange things in an icon view, you're
likely to lose all your hand-sorts. Via a third party tool,
a tool which records icon position when you use a hotkey,
you can "make" a feature out of this.

3) The third one, I'd never hear of before until now.
For certain combinations of columns, Explorer supports
"shift-click" secondary selection. You can click the
Type field and have all the Applications ending in .exe
sorted into order. Then, if you hold the Shift key
and hit the Size field, the Applications stay together,
but their secondary sort order is via ascending or
descending size.

Note that arbitrary combinations of columns do not work.
This is why you would not have discovered this by accident.
And... the most useful combinations don't work.

The only point of mentioning all this, is to give
you some idea how large the fault tree is for this
question.

I'm pretty sure one of the sort orders by name is
called "canonical", but I don't know what exactly
the other one is called. Maybe someone else can find
an article with clearer examples.

HTH,
Paul
VanguardLH
2018-08-02 07:56:56 UTC
Reply
Permalink
Raw Message
Post by pjp
Post by VanguardLH
Post by pjp
I'm doing images of my various systems and collecting them on one hard
disk. I notice a very "wrong" sort ordering when viewing the files.
The names in question in the order the appear are
INTEL-FRONTROOM
INTELI5
INTEL-RECROOM
INTEL-SUNPORCH
Shouldn't the INTELI5 entry appear at the bottom of this collection.
Think ascii character "-" comes before any letters but I haven't
checked. Reversing sort order keeps the anamoly, just reversed.
It's as if the hyphen is stripped from the filename before sorting.
Displayed on both Home and Pro 32 & 64 bit.
Now why the hell would anyone do that???
Sorting WHAT? Windows Explorer? There are lots of file managers or
other file tools.
If using Windows Explorer, are you clicking on the Name column header to
sort on that column? You show what appear to be only the filenames, so
you have the filetype hidden. Configure Windows Explorer to show the
extension (filetype): Tools -> Folder Options -> View tab, disable the
"Hide extensions for known file types" option. Could be you are mixing
filetypes in your sort.
No that's certainly not relevant seeing as I'm specifically talking
about folders here.
"when viewing the files". Sure looked like you were asking about files,
especially since folders weren't mentioned in your starting post.
Post by pjp
The examples I gave are all image backups folders
made by Windows backup. In other words they are simply the names of the
various pcs and used as folder names, the image backup creates the
folders. There's nothing specifically special about any of them, just
have some files and folders inside them. Just seems so odd that the
hyphen for all intents and purposes doesn't seem to exist for the
sorting. It must get stripped out rather than even converted to a space
by the behaviour it exibits, e.g. INTEL-RECROOM becomes INTELRECROOM and
that's what it uses to do the sorting.
As I said very odd and not expected if nothing else.
Perhaps it has to do with intuitive numbering order established since
Windows XP. See:

https://www.askvg.com/how-to-disable-numerical-file-name-sorting-and-enable-classic-literal-sorting-in-windows-xp-vista-and-7-explorer/

See if reverting to literal sorting order makes a change in how the
folders are arranged in Windows Explorer.

Loading...