Sorting bug w/photos

  • Thread starter Thread starter Sproo
  • Start date Start date
S

Sproo

1---b---.jpg
1-b-----.jpg
1---c---.jpg

See anything wrong with this picture?
Either a b sorts before a dash, or a dash sorts before a b. So the item
in the middle should be anywhere but in the middle.

What the hell is the matter with Exploder today?
 
Yves said:
This must be due to how the dash character is encoded and how XP reads it.
Funny things can happen in sorting in hell as explained here:
http://nevcal.com/eclectic/file_sorting.html

I don't see where this helps, and I don't see how the URL is relevant,
since it deals with numeric sorting. The names I just gave have only
nonnumeric characters and don't sort as expected. The registry hack at
the site, aside from being a registry hack and therefore something
better off avoided, would change number sorting, however, which I don't
especially want.
 
I don't think you understand how sorting (listing) is done.
The site I listed gave you a brief history of how a computer "looks" at the
file names and "decides" how to list them. All kinds of rules can be set. XP
decided to use a particular rule. Get with it.
So, you have files with non numeric characters.
So what? Who cares?
You want to name photo files:
1---b---.jpg
1-b--.jpg
etc. Go ahead, funny file naming but it is your computer and you can name
photo files any way you want.
XP and any other software will "look" at a non numerical character and
decide, based on the encoding of this character, how it should list it (or
sort it) in a folder.
According to you, when you have a dash in a file name, should the dash be
listed before the letter a or the number one or before @ or before or after
_?
It is very simple. Your computer does not know a, 1, @ - or _ or -. It does
not know any of these characters, none!
How should your computer list the following files?
@.jpg
_.jpg
-.jpg
^.jpj
(.jpg
1.jpg
You want to give me the order? Do you want to tell me that -.jpg should be
listed below or above @.jpg and if so, tell me why.

Answer this and then I will tell you why your --- files are listed in the
order they are. Nothing wrong with Explorer, it is doing the job properly.
It sees the - characters and sorts the file in the order they should be,
according to the encoding of the - character and XP rules to sort files.
 
Actually, the OP's example demonstrates quite clearly that there is
no simple collating sequence, interpreted from left to right, that
can explain the sort order he observed:

1---b---.jpg
1-b-----.jpg
1---c---.jpg

That is interesting. ;-)

It made me wonder if all of his '-' characters were in the same
alphabet, or if some were some other region of Unicode...

-michael
 
Yves said:
I don't think you understand how sorting (listing) is done.

I bloody well do, and I see no reason to insult me either.

I know that if - sorts before b, then -b and -c must sort before b-; if
- sorts after b, they must both sort after b-. They cannot sort with b-
in the middle.

The site details XP's separating out numerical fields, which can result
in funny sort orders for mixed alphanumeric strings (such as hex
numbers); that is, however, completely irrelevant in this case because
the sample file names do not contain any digit characters whatsoever.
You want to give me the order? Do you want to tell me that -.jpg should be
listed below or above @.jpg and if so, tell me why.

Either will do if it's consistent, but before @ some of the time and
after @ other times depending on the phase of the moon? Uh-uh. Sorry.
No can do.
Answer this and then I will tell you why your --- files are listed in the
order they are. Nothing wrong with Explorer, it is doing the job properly.

I don't agree.
It sees the - characters and sorts the file in the order they should be,
according to the encoding of the - character and XP rules to sort files.

Which differ from normal ASCII order -- for the case of numeric
characters appearing. If none appear, it should sort identically to
MS-DOS, but clearly doesn't.
 
Michael said:
Actually, the OP's example demonstrates quite clearly that there is
no simple collating sequence, interpreted from left to right, that
can explain the sort order he observed:

1---b---.jpg
1-b-----.jpg
1---c---.jpg

That is interesting. ;-)

It made me wonder if all of his '-' characters were in the same
alphabet, or if some were some other region of Unicode...

They are all hyphens entered on a bog-standard keyboard. ASCII 45.
Should consistently sort before all alphanumeric characters. XP's
number sort shouldn't affect this -- it should break all three of the
above into one numeric field, all the same (1) and so not affecting the
sort, and one nonnumeric field, which should sort with the middle item
first and the other two following in order.
 
I don't think so.
We have:
1---b---.jpg
1-b-----.jpg
1---c---.jpg
So we expect the correct order to be:
1---b---.jpg
1---c---.jpg
1-b-----.jpg
Does not happen with XP.

Replace the - with the letter a or replace the - with &
Now you will get the expected correct order using a or & instead of -
Now go to the command prompt and list the files.
Surprise. Using - or a or & will result in exactly the same expected correct
sorting order.
 
Replace the - with the letter a or replace the - with &

The whole idea was to use a symbol that doesn't clutter up the display
visually. :P
 
Then simply use underline instead of - and it will work.
1___b___.jpg
1___c___.jpg
1_b_____.jpg
The above will sort in the order you expect.
In fact, I think the above looks less cluttered and easier to read on your
display than:
1---b---.jpg
1-b-----.jpg
1---c---.jpg
 
First I had no intention of insulting you. Sorry if my post came this way.
This is a very friendly site.
Yes, it should sort identically to MS-DOS. But it does not. XP changed the
rules! Complaints after complaints about this. Sometimes it does sort
identically to MS-DOS and sometimes it does not! But when it does not, it
consistentently does not.
Here is another example:
http://windowsxp.mvps.org/xpsortorder.htm
Will blow your mind trying to figure out what is going on when you string
numerical, alphabetical and other characters together in a file name.
 
As I said, this is a very friendly site. Just in case you did not see my
solution posted above, here it is again:

Then simply use underline instead of - and it will work.
1___b___.jpg
1___c___.jpg
1_b_____.jpg
The above will sort in the order you expect.
In fact, I think the above looks less cluttered and easier to read on your
display than:
1---b---.jpg
1-b-----.jpg
1---c---.jpg
 
Back
Top