Sorting on custom columns with range

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
marlar
Junior Member
Junior Member
Posts: 40
Joined: 2010-03-08, 11:18 UTC

Sorting on custom columns with range

Post by *marlar »

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
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Sorry, it is known issue that TC doesn't sort by partial strings.

It was discussed e.g. here.
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Really, this should go under Behaviour which will be changed. :) Columns should be sorted / sortable by what they actually show.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
marlar
Junior Member
Junior Member
Posts: 40
Joined: 2010-03-08, 11:18 UTC

Post by *marlar »

Hacker wrote:Really, this should go under Behaviour which will be changed. :) Columns should be sorted / sortable by what they actually show.
I fully agree.

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.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can use my "filesys" sample plugin, it has a field "Cutname":
https://plugins.ghisler.com/content/wdx_filesys.zip
Author of Total Commander
https://www.ghisler.com
marlar
Junior Member
Junior Member
Posts: 40
Joined: 2010-03-08, 11:18 UTC

Post by *marlar »

Thanks, that actually solves the specific problems.

However, it would still be nice with a more generic solution to sorting on partial columns :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler,
Why not leave it on user? There is no problem with string fields support.
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Christian,
This could be solved by a simple checkbox for each column - "Sort by displayed value".

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply