Sorting on custom columns with range
Moderators: Hacker, petermad, Stefan2, white
Sorting on custom columns with range
I have a bunch of files named like this:
2012-11-18 (04.16) MVI_2193.MOV
2012-10-09 (01.12) MVI_1860.MOV
The number in parenthesis is the duration in mm.ss.
I wish to sort these files by duration, so I create a custom column with this setting:
[=tc.name:13-17]
The column will display like this:
Duration
04.16
01.12
Now I thought I could simply click on the Duration column, but no! It sorts by the full name, not the selected range. So it does not work.
I think the sorting should be done on the text as shown in the column, that is probably what most users would expect.
TC 8.01
2012-11-18 (04.16) MVI_2193.MOV
2012-10-09 (01.12) MVI_1860.MOV
The number in parenthesis is the duration in mm.ss.
I wish to sort these files by duration, so I create a custom column with this setting:
[=tc.name:13-17]
The column will display like this:
Duration
04.16
01.12
Now I thought I could simply click on the Duration column, but no! It sorts by the full name, not the selected range. So it does not work.
I think the sorting should be done on the text as shown in the column, that is probably what most users would expect.
TC 8.01
I fully agree.Hacker wrote:Really, this should go under Behaviour which will be changed.Columns should be sorted / sortable by what they actually show.
Maybe Christan will reconsider now after 3 years? Even if there is a problem with numbers being sorted incorrectly, that would be still be better than nothing since text sorting would work well enough.
A good solution would be to have a built-in default text sorting, and then a call back function which the plugins could implement for custom sorting. Something like the php usort() function.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
You can use my "filesys" sample plugin, it has a field "Cutname":
https://plugins.ghisler.com/content/wdx_filesys.zip
https://plugins.ghisler.com/content/wdx_filesys.zip
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The problem is that it would break some other columns. For example, if you have a date column showing 31.12.2012 and want to see just 12.2012, you could use [fielname:4-]. But you still want to sort by date. If TC would sort by the characters from position 4, dates with different years would be sorted incorrectly (01.2013 before 12.2012).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com