Files and folders are not correctly sorted

Bugs which are supposed to be fixed in the next test version (not available yet)

Moderators: XnTriq, xnview, Dreamer

Post Reply
MarlonB
Posts: 13
Joined: Sun Jul 12, 2020 9:35 pm

Files and folders are not correctly sorted

Post by MarlonB »

Hi,

I have several folders with 50k+ images, and when I sort them in XnView, the sorting isn't always correct. For example, I'm looking at a long list right now which has a sort order of:
  • 0007*
  • 007**
  • 07***
  • 7****
  • 000**
So until the filenames begin with a "7", all is sorted correctly, afterwards, files starting with "0" start appearing again. This happens within the same folder on numerous occasions

The folders themselves are sorted incorrectly as well, for example:
  • pea
  • peaf
  • peaf-k
  • pea-k
I'd assume these folders to be sorted as
  • pea
  • pea-k
  • peaf
  • peaf-k
as the dash comes before the letters ASCII wise.

I've tried changing the setting Browser / File list / Folder always sorted alphabetically, but this doesn't change anything.

edit: forgot to mention, I'm using
XnView MP Windows
Version 0.98.2 64bits (Feb 19 2021)

Any idea how to get these sorted correctly?

Thanks!

Marlon
User avatar
masterjp
Posts: 203
Joined: Fri Feb 13, 2009 4:37 pm
Location: Duesseldorf (Germany)

Re: Files and folders are not correctly sorted

Post by masterjp »

I created your folder names within a directory and the sorting is correct!

0000
007
07

pea
pea-f
pea-k

Maybe your sorting filter is set to another entry?

Maybe you use a "o" and not a "0" (=zero)?

Try to rename the folder with "0000" to "test" and rename it back to "00000".



Sort by name should work perfect.

Here you can see the result:
XnViewMP.png
XnViewMP.png (11.44 KiB) Viewed 479 times
PC: Intel 8700k + Asus Z370-F + 16 GB RAM G.Skill
OS: Windows 10 Pro x64 (latest updates) | XN-View (latest stable version) |XnViewMP (latest stable and beta version) | XnConvert (latest) | Adobe Photoshop Elements 2021 & Elements XXL 8
MarlonB
Posts: 13
Joined: Sun Jul 12, 2020 9:35 pm

Re: Files and folders are not correctly sorted

Post by MarlonB »

masterjp wrote: Tue Apr 06, 2021 11:35 am Maybe your sorting filter is set to another entry?
I might be mistaken when sorting... I see you set the sort order by selecting the order with those two green arrows, I just pressed the column header.
masterjp wrote: Tue Apr 06, 2021 11:35 am Maybe you use a "o" and not a "0" (=zero)?

Try to rename the folder with "0000" to "test" and rename it back to "00000".
No, I'm sure of that (and renaming a few test files didn't change anything).
masterjp wrote: Tue Apr 06, 2021 11:35 am Sort by name should work perfect.
I agree :)

I've changed the sort order via the green arrows to "Name (not numeric) + Ascending", and now the sort order for files is correct. For folders, however, the sort order remains incorrect, even after prepending the folders:
Image

As you can see, the order is incorrect - abpea-f should not follow abpeaf, it should follow abpea and come before abpea2. Changing the order via column sort only reverses the (incorrect) order, changing the sort order via the green arrows doesn't change anything, and changing "folders always sorted alphabetically" doesn't affect the sort order either.

Thanks,

Marlon

PS: when I set the sort order to "name", a little up arrow appears on the name column indicating the sort order. However, this arrow does not appear when I select "name (numeric)" - I find this odd, since the sort is still being performed on the name column (even though the sort is different).
User avatar
xnview
Author of XnView
Posts: 34932
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Files and folders are not correctly sorted

Post by xnview »

MarlonB wrote: Tue Apr 06, 2021 7:19 pm As you can see, the order is incorrect - abpea-f should not follow abpeaf, it should follow abpea and come before abpea2. Changing the order via column sort only reverses the (incorrect) order, changing the sort order via the green arrows doesn't change anything, and changing "folders always sorted alphabetically" doesn't affect the sort order either.
You have the same order as Windows explorer
Pierre.
MarlonB
Posts: 13
Joined: Sun Jul 12, 2020 9:35 pm

Re: Files and folders are not correctly sorted

Post by MarlonB »

xnview wrote: Wed Apr 07, 2021 6:53 am You have the same order as Windows explorer
I never said the Windows explorer order was the correct one :|

When I'm working with a lot of files, I tend to switch between the command line and my image viewer (which has become XnView MP since a year or so). In the command line, the sort order is correct and as it should be - alphabetically / ascii sorted, which is what I expected to get when I sorted in XnView.

So basically there's no option at the moment to perform an alphabetical sort on a column?
User avatar
xnview
Author of XnView
Posts: 34932
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Files and folders are not correctly sorted

Post by xnview »

will be added, See issue for current status and some details.
Pierre.
Post Reply