Suggeston to improve the sorting of files and folders
Posted: 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:
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:
Sorting by filename or folder gives the same result as above:
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:
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:
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):
And to the user, it would look like this:
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
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
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
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
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 ---/