Curious Windows Explorer sort problem....

  • Thread starter [SPICEISLE.COM] Brian Steele
  • Start date
S

[SPICEISLE.COM] Brian Steele

I've noticed a curious Windows Explorer sort problem. I've noticed it in
XP, but perhaps it might show up on other versions.

To recreate the problem, do this: in a folder, create text files with the
following names: DOML677.TXT, JAML5BA.TXT, JAML72F.TXT, JAML952.TXT and
JAML9ED.TXT. Now, use Explorer to sort them by name and take a look at the
order in which they're sorted.

You'd expect to see something like this:

DOML677
JAML5BA
JAML72F
JAML952
JAML9ED


....but what you'd likely end up with is this:

DOML677
JAML5BA
JAML9ED (?)
JAML72F (?)
JAML952 (?)


Any ideas on what might be causing this? A bug in Explorer's sorting
algorithm perhaps? :)



Regards,
Brian
 
K

Ken Blake, MVP

I've noticed a curious Windows Explorer sort problem. I've noticed it in
XP, but perhaps it might show up on other versions.

To recreate the problem, do this: in a folder, create text files with the
following names: DOML677.TXT, JAML5BA.TXT, JAML72F.TXT, JAML952.TXT and
JAML9ED.TXT. Now, use Explorer to sort them by name and take a look at the
order in which they're sorted.

You'd expect to see something like this:

DOML677
JAML5BA
JAML72F
JAML952
JAML9ED


...but what you'd likely end up with is this:

DOML677
JAML5BA
JAML9ED (?)
JAML72F (?)
JAML952 (?)


Any ideas on what might be causing this? A bug in Explorer's sorting
algorithm perhaps? :)


No, it's not a bug. It's done this way on purpose. JAML9ED precedes
JAML72F because 9 is a lower number than 72.

However, you can change the sorting to the text-based way you
apparently prefer. See http://support.microsoft.com/kb/319827
 
J

JS

Also take note that Windows makes
no special distinction between Upper
and Lower case letters in that you
can't have two files of the same name
one in Upper and the other in Lower.

abc.txt = ABC.txt
 
S

[SPICEISLE.COM] Brian Steele

Ah, ok, that partly explains it. I guess my next question is why would they
change the sort order that way...


Thanks,
Brian
 
B

Bill in Co.

[SPICEISLE.COM] Brian Steele said:
Ah, ok, that partly explains it. I guess my next question is why would
they
change the sort order that way...

Thanks,
Brian


Ken Blake said:
No, it's not a bug. It's done this way on purpose. JAML9ED precedes
JAML72F because 9 is a lower number than 72.

However, you can change the sorting to the text-based way you
apparently prefer. See http://support.microsoft.com/kb/319827

I think because they considered it more "logical". Probably for the same
reason they changed the default sorting order (in XP) to give these results
(IIRC):

Test 1
Test 2
Test 11

instead of (as before, like in Win9x):

Test 1
Test 11
Test 2

But sometimes that sorting method works better for me, just like for the
example you gave, so I changed it to that (older) sorting method.
 
K

Ken Blake, MVP

Ah, ok, that partly explains it. I guess my next question is why would they
change the sort order that way...



Because what order makes the most sense depends on what you are
sorting. For example, consider the following list. Which order is
correct?

July 1
July 2
July 3
July 4
July 5
July 6
July 7
July 8
July 9
July 10


or

July 1
July 10
July 2
July 3
July 4
July 5
July 6
July 7
July 8
July 9





 
B

Bill in Co.

True enough, except sometimes I find the other way preferable - I'm trying
to remember which files - but the example he gave I guess would be one.
To repeat, this way seems better (as he wanted it to be - the old sort
method):

Generally works better for me. We just have to remember to use leading
zeroes in the filenames, when there are ten or more similarly named files.
Like this:

File01
File02
File03 (etc)
File10
File11

But at least the OP's sort problem above is avoided this way.


Ah, ok, that partly explains it. I guess my next question is why would
they
change the sort order that way...



Because what order makes the most sense depends on what you are
sorting. For example, consider the following list. Which order is
correct?

July 1
July 2
July 3
July 4
July 5
July 6
July 7
July 8
July 9
July 10


or

July 1
July 10
July 2
July 3
July 4
July 5
July 6
July 7
July 8
July 9





Ken Blake said:
On Thu, 23 Jul 2009 10:55:21 -0400, "[SPICEISLE.COM] Brian Steele"

I've noticed a curious Windows Explorer sort problem. I've noticed it
in
XP, but perhaps it might show up on other versions.

To recreate the problem, do this: in a folder, create text files with
the
following names: DOML677.TXT, JAML5BA.TXT, JAML72F.TXT, JAML952.TXT and
JAML9ED.TXT. Now, use Explorer to sort them by name and take a look at
the
order in which they're sorted.

You'd expect to see something like this:

DOML677
JAML5BA
JAML72F
JAML952
JAML9ED


...but what you'd likely end up with is this:

DOML677
JAML5BA
JAML9ED (?)
JAML72F (?)
JAML952 (?)


Any ideas on what might be causing this? A bug in Explorer's sorting
algorithm perhaps? :)


No, it's not a bug. It's done this way on purpose. JAML9ED precedes
JAML72F because 9 is a lower number than 72.

However, you can change the sorting to the text-based way you
apparently prefer. See http://support.microsoft.com/kb/319827
 
R

RJK

July 1
July 10
July 2
July 3
July 4


Since the first MS OS's, MS GUI's, and now MS scrambled together OS+GUI's,
I've always prefixed numbers in filenames with zeros. i.e. such padding out
fixes the filename ordering, e.g.
July 01
July 02
July 03
July 04
July 05
July 06
July 07
July 08
July 09
July 10

....helps with directories containing hundreds of of photos e.g. pic001.jpg,
or if there's a huge amount in there pic00001.jpg etc. ! :)

regards, Richard.
 
K

Ken Blake, MVP

Since the first MS OS's, MS GUI's, and now MS scrambled together OS+GUI's,
I've always prefixed numbers in filenames with zeros. i.e. such padding out
fixes the filename ordering, e.g.


...helps with directories containing hundreds of of photos e.g. pic001.jpg,
or if there's a huge amount in there pic00001.jpg etc. ! :)


There's no question that what you say is generally good to do.
Nevertheless the newer way of sorting is designed to take care of the
situation where that was *not* done.
 
B

Bill in Co.

There's no question that what you say is generally good to do.
Nevertheless the newer way of sorting is designed to take care of the
situation where that was *not* done.

But then you get into the problem illustrated by the OP, where the sort
order was obviously incorrect. To repeat, this is the desired result:

And NOT THIS:

So it seems to me that the older method may generally work out better, as it
will work in ALL cases, I believe, so long as you remember to use the
leading zeroes (in the specific case of multiple numbered files). Isn't
that a small price to pay to have it work out "more universally", correctly?
:)
 
K

Ken Blake, MVP

But then you get into the problem illustrated by the OP, where the sort
order was obviously incorrect. To repeat, this is the desired result:


And NOT THIS:


So it seems to me that the older method may generally work out better, as it
will work in ALL cases, I believe, so long as you remember to use the
leading zeroes (in the specific case of multiple numbered files). Isn't
that a small price to pay to have it work out "more universally", correctly?
:)



My intent here was not to argue for or against either method of
sorting. I was simply pointing out why, as far as I know, Microsoft
chose to change the method.

In my view both methods have their advantages and disadvantages. Using
leading zeros, when *you* create the name, is good to do, and it makes
it work with either method of sorting. But sometimes you are the
recipient of the bunch of files and don't create their names yourself,
so you don't get to choose the leading zeros.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top