Suggeston to improve the sorting of files and folders

The best solution for finding and removing duplicate files.
Post Reply
punar
Posts: 7
Joined: Sun May 22, 2016 5:02 pm

Suggeston to improve the sorting of files and folders

Post by punar » Sun May 22, 2016 5:41 pm

Edit by punar 2017-01-07:
Sorting has been fixed in v4.0.4
Thread can be deleted
-----------------------------------



I find sorting by filename or folder illogical. Files are just sorted within groups.

For the purpose of this explanation, I have made an example folder. Please unpack the subfolders with the tiny jpg-images.
I tried to make lists of what I expect and what I get, but I couldn't find a way to make it look neat in this forum thread, so please excuse the poorly formatted lists.

Search criteria: Regular mode, Same content.


Original jpg-files in zip-fle:

Code: Select all

Folder   File
test1    13orange
test1    14red
test2    21blue
test2    22green
test3    31blue
test3    32green
testA    A5white
testA    A6yellow
testB    B5white
testB    B6yellow
testC    C3orange
testC    C4red
I gave the file names a number in the front to indicate the sort order of the filename (it's easier to see out-of-sort numbers than letters).


DP4 scan produces this result:

Code: Select all

File      Folder	Group
21blue    test2     1
31blue    test3     1
14red     test1     2
C4red     testC     2
13orange  test1     3
C3orange  testC     3
A6yellow  testA     4
B6yellow  testB     4
A5white   testA     5
B5white   testB     5
22green   test2     6
32green   test3     6


Sorting by filename or folder gives the same result as above:

Code: Select all

File      Folder   Group
21blue    test2    1
31blue    test3    1
14red     test1    2
C4red     testC    2
13orange  test1    3
C3orange  testC    3
A6yellow  testA    4
B6yellow  testB    4
A5white   testA    5
B5white   testB    5
22green   test2    6
32green   test3    6
But it looks strange that you sort by filename, and then you find for example 21blue is placed before 13orange. Files and folders are just sorted within the groups.

I wish sorting by folder would look like this:

Code: Select all

File      Folder   Group
14red     test1    2
C4red     testC    2
13orange  test1    3
C3orange  testC    3
21blue    test2    1
31blue    test3    1
22green   test2    6
32green   test3    6
A6yellow  testA    4
B6yellow  testB    4
A5white   testA    5
B5white   testB    5
See how folder-names are better held together.

Here's how I would code this

(I am not a coder, so there's surely a more elegant way to do this, but at least it works in Excel)
You need to add a new column to the list (not shown for users).
I would call it FirstFolderInGroup:

Code: Select all

File      Folder   Group   FirstFolderInGroup
21blue    test2    1       test2
31blue    test3    1       test2
14red     test1    2       test1
C4red     testC    2       test1
13orange  test1    3       test1
C3orange  testC    3       test1
A6yellow  testA    4       testA
B6yellow  testB    4       testA
A5white   testA    5       testA
B5white   testB    5       testA
22green   test2    6       test2
32green   test3    6       test2

To create the FirstFolderInGroup-list, I would scan through the list and apply something like this:

First, make sure that folders are sorted within each group (the way they are sorted in your application now)
Then apply this:
If Group[ThisItem] <> Group[PreviousItem] Then FirstFolderInGroup[ThisItem] = Folder[ThisItem]
Else FirstFolderInGroup[ThisItem] = FirstFolderInGroup[PreviousItem]



Then, when someone wants to sort by Folder

Instead of the previous:
Sort by Folder
Sort by Group

You now should

Sort by Folder
Sort by Group
Sort by FirstFolderInGroup

The same must be applied for filenames, by adding a column: FirstFilenameInGroup
It would give this result (where the columns FirstFilenameInGroup and FirstFolderInGroup ar not show to the user):

Code: Select all

File       Folder   Group   FirstFilenameInGroup   FirstFolderInGroup
13orange   test1    3       13orange               test1
C3orange   testC    3       13orange               test1
14red      test1    2       14red                  test1
C4red      testC    2       14red                  test1
21blue     test2    1       21blue                 test2
31blue     test3    1       21blue                 test2
22green    test2    6       22green                test2
32green    test3    6       22green                test2
A5white    testA    5       A5white                testA
B5white    testB    5       A5white                testA
A6yellow   testA    4       A6yellow               testA
B6yellow   testB    4       A6yellow               testA
And to the user, it would look like this:

Code: Select all

File       Folder   Group
13orange   test1    3
C3orange   testC    3
14red      test1    2    ---\  Files are kept within their groups (much better
C4red      testC    2    ---/  than the promoted solution to turn grouping off)
21blue     test2    1
31blue     test3    1
22green    test2    6
32green    test3    6
A5white    testA    5    ---\
B5white    testB    5    ----\  Files from the same folders are held 
A6yellow   testA    4    ----/  together, like they are supposed to
B6yellow   testB    4    ---/
Last edited by punar on Sat Jan 07, 2017 1:01 am, edited 17 times in total.
User avatar
therube
Posts: 479
Joined: Tue Jun 28, 2011 4:38 pm

Re: Suggeston to improve the sorting of files and folders

Post by therube » Sun May 22, 2016 9:24 pm

Seems current sort is:

By, Group
Then, Path+Filename

To note, in Duplicate Cleaner 4, you can disable the Group sort first.
And if you do so, looks like the sort [for other then a Name sort] is:

By, Path [not so sure about that, cause sample set is too small, without enough randomness]
Then, by the chosen sort column


(Sort looks to be case sensitive, which might be a little odd?
Eh, but might not be so? With no option to always display size in bytes, cannot know if two "1.25 MB" files are the same size or not?)


OK, have to stop.
Too many unknowns, & all I"m doing now is surmising, & I'm coming across inconsistencies.
User avatar
therube
Posts: 479
Joined: Tue Jun 28, 2011 4:38 pm

Re: Suggeston to improve the sorting of files and folders

Post by therube » Sun May 22, 2016 9:26 pm

@punar,
  • does not look to be working as you're wanting it to.
    Replacing your
    • with

      Code: Select all

       tags should help out (readability of) your post.
punar
Posts: 7
Joined: Sun May 22, 2016 5:02 pm

Re: Suggeston to improve the sorting of files and folders

Post by punar » Sun May 22, 2016 10:12 pm

Ah, thanks for input Therube.
I see that the .zip-file I posted had too homogeneous names for my example to show the problem when "Always sort by group first" was disabled. With my first .zip-file and that option disabled, files would actually sort correctly due to my mistaken choice of filenames.

I updated my first post with a new .zip file with better filenames that show my point more clearly.
punar
Posts: 7
Joined: Sun May 22, 2016 5:02 pm

Re: Suggeston to improve the sorting of files and folders

Post by punar » Wed May 25, 2016 10:55 pm

Actually, turning off "Always sort by group first" is useless. Grouped files aren't held together. So now you have to guess if you have already marked the other file or not?
I think my suggestion accomplishes what this function is meant to do.

-----


Edit 2017-01-07:
Version 4.0.4 is out. Sort function has been fixed.
Post Reply