Improve File Name Display by Cutting Characters in the Middle
Moderators: Hacker, petermad, Stefan2, white
Improve File Name Display by Cutting Characters in the Middle
Hello!
I would like to suggest an improvement for how Total Commander handles long file names. Currently, when a file name is too long to display fully, it gets cut off at the end. However, in many cases, the most important parts of a file name are both the beginning and the end. Wouldn't it be more useful to trim the middle part of the file name instead, while still showing the start and end?
For example:
Instead of:
VeryLongFileNameThatDoesntFitHere20241003.ext becoming VeryLongFileName....ext
It could become something like:
VeryLong...20241003.ext
This would be especially helpful when you have several files with the same name that differ only in their last characters. Identifying those files quickly would be much easier if both the beginning and end are visible.
I apologize if this has been suggested before. I used the search function of the forum but found nothing related.
Best regards,
quik
P.S. Thank you very much for this incredible piece of software. I've been using it for the last 25 years and can't live without it!
I would like to suggest an improvement for how Total Commander handles long file names. Currently, when a file name is too long to display fully, it gets cut off at the end. However, in many cases, the most important parts of a file name are both the beginning and the end. Wouldn't it be more useful to trim the middle part of the file name instead, while still showing the start and end?
For example:
Instead of:
VeryLongFileNameThatDoesntFitHere20241003.ext becoming VeryLongFileName....ext
It could become something like:
VeryLong...20241003.ext
This would be especially helpful when you have several files with the same name that differ only in their last characters. Identifying those files quickly would be much easier if both the beginning and end are visible.
I apologize if this has been suggested before. I used the search function of the forum but found nothing related.
Best regards,
quik
P.S. Thank you very much for this incredible piece of software. I've been using it for the last 25 years and can't live without it!
Re: Improve File Name Display by Cutting Characters in the Middle
Support. At least this can be done as an option.
Overquoting is evil! 👎
Re: Improve File Name Display by Cutting Characters in the Middle
2quik
How many of the end characters would you suggest that TC should show? 8, as in your excanple?
How many of the end characters would you suggest that TC should show? 8, as in your excanple?
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Improve File Name Display by Cutting Characters in the Middle
It seems to me that a more correct answer would be - just insert an ellipsis in the middle of a long name.
That is, ALL possible characters should remain visible, and only approximately exactly in the middle of
a long text should a few characters disappear - to allow a simple ellipsis to be inserted there.
That is, ALL possible characters should remain visible, and only approximately exactly in the middle of
a long text should a few characters disappear - to allow a simple ellipsis to be inserted there.
Code: Select all
So for a full name like:
ThisIsEndeedAVeryLoooooooooooooooooooooooongTitleYouEverSeenBeforeAndItDemonstratesADesirableApporach.txt
with next visual borders for rendering the text:
| |
a cut-off version of this file name Will become:
|ThisIsEndeedAVeryLoooooooooooooooooooooooong...AndItDemonstratesADesirableApporach.txt|
#146217 personal license
Re: Improve File Name Display by Cutting Characters in the Middle
Strong Support++
where a positive n is the number of chars to be shown at the end, and a negative value is treated as a percentage.
Default value: 0.
Examples:
n=8 would always show the last 8 chars
n=0 turns the option off (as it currently is)
n=-50 would split in the middle and show the last 50% (as exemplified by AntonyD)
If done as an option, how about an ini entry like
Code: Select all
alwaysShowLastChars=n
Default value: 0.
Examples:
n=8 would always show the last 8 chars
n=0 turns the option off (as it currently is)
n=-50 would split in the middle and show the last 50% (as exemplified by AntonyD)
Re: Improve File Name Display by Cutting Characters in the Middle
I think this one would be the correct way to do it.AntonyD wrote: 2024-10-03, 16:14 UTC It seems to me that a more correct answer would be - just insert an ellipsis in the middle of a long name.
That is, ALL possible characters should remain visible, and only approximately exactly in the middle of
a long text should a few characters disappear - to allow a simple ellipsis to be inserted there.
Re: Improve File Name Display by Cutting Characters in the Middle
Support++funkymonk wrote: 2024-10-03, 17:22 UTC If done as an option, how about an ini entry likewhere a positive n is the number of chars to be shown at the end, and a negative value is treated as a percentage.Code: Select all
alwaysShowLastChars=n
Default value: 0.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Improve File Name Display by Cutting Characters in the Middle
The idea of a percentage is somewhat dubious due to the limitation of the number of characters, which can be, for example, 2-3 in the name, and we can reduce the width of the panels as we like. It's clear that the percentage can be adjusted up or down, but I believe that the approximate middle in any case should be the lower limit, i.e. the second half should be the decreasing side.funkymonk wrote: 2024-10-03, 17:22 UTC n=8 would always show the last 8 chars
n=0 turns the option off (as it currently is)
n=-50 would split in the middle and show the last 50% (as exemplified by AntonyD)
When specifying a smaller number of characters from the end, for example 5, even when taking it as a rule to leave at least one character at the beginning, when reducing the width of the panel it may look like this:
- Total Commander
Total ..mander
Total ..ander
Total..ander
Tota..ander
Tot..ander
To..ander
T..ander
T..nder
T..der
T..er
T..r
T..
T.
T
If only the middle is used, however, it will look like this:
- Total Commander
Total ..mander
Total ..ander
Total..ander
Total..nder
Tota..nder
Tota..der
Tot..der
Tot..er
To..er
To..r
T..r
T..
T.
T
If too small or large a percentage is specified, for example, 1 or 99, then this would become useless in many cases.
But we can consider, for example, the following scheme:
0 — dots at position 8/8, i.e. at the end of the name (default)
1 — dots at position ~7/8
2 — dots at position ~6/8
3 — dots at position ~5/8
4 — dots at position ~4/8, i.e. about the middle
I think that would be more than enough.
And then the question arises, what to do with the extension in the case of this option? > cm_ConfTabChange > Show file extensions: ◉ aligned (with Tab)
It also reduced according to the same rules as the base name. Is it correct to use a common rule or should it not be applied to an extension?
Overquoting is evil! 👎
Re: Improve File Name Display by Cutting Characters in the Middle
Has been suggested (by me) almost 20 years ago: viewtopic.php?t=6173
Re: Improve File Name Display by Cutting Characters in the Middle
Very good idea. I support it.
Removed characters could be selected in some clever way (not always according to the set mask). E.g. according to how similar file names differ from each other.
Removed characters could be selected in some clever way (not always according to the set mask). E.g. according to how similar file names differ from each other.
Re: Improve File Name Display by Cutting Characters in the Middle
Well, I found AntonyD's suggestion (50%) reasonable and wanted to account for it. Personally, an adjustable integer number for the chars would be sufficient for me.Fla$her wrote: 2024-10-04, 02:39 UTC The idea of a percentage is somewhat dubious due to the limitation of the number of characters, which can be, for example, 2-3 in the name, and we can reduce the width of the panels as we like. It's clear that the percentage can be adjusted up or down, but I believe that the approximate middle in any case should be the lower limit, i.e. the second half should be the decreasing side.
Depending on the situation, it might be useful to see only the last chars. For me it is common to work with filenames likeFla$her wrote: 2024-10-04, 02:39 UTC When specifying a smaller number of characters from the end, for example 5, even when taking it as a rule to leave at least one character at the beginning, when reducing the width of the panel it may look like this:
AVeryLongFileNamePrefix00001
AVeryLongFileNamePrefix12922
AVeryLongFileNamePrefix22112
AVeryLongFileNamePrefix33112
Using alwaysShowLastChars=5 would at least show me the number at the end of the filename -- which is more important than the prefix in this example:
...00001
...12922
...22112
...33112
Of course, if there is not enough space to display the n chars and the ellipsis, then we are out of luck and more than n chars need to be removed. But that problem can only be solved by providing more space anyways.
Thus, one more idea:
The ellipsis "..." or ".." is probably the intuitive way to go. However, it eats up 2-3 chars (and there might even be filenames that indeed contain 2-3 dots in a row).
How about using a special char/indicator that (1) is visually striking, (2) cannot be used in filenames anyways, and (3) needs less space?
Re: Improve File Name Display by Cutting Characters in the Middle
Such an analysis will definitely slow down the output of the list.
This is a special case and not to say that it's the most popular. For example, it could be useful for downloaded episodes via torrent. But in 85-90 percent of such files, the numbers are located, alas, not at the very end of the base name. Therefore, be that as it may, I would prefer the middle as a starting point. If there was some cm_ command with a parameter that could be used to toggle this view, then such flexibility would be more tangible.funkymonk wrote: 2024-10-04, 09:47 UTCDepending on the situation, it might be useful to see only the last chars. For me it is common to work with filenames like
AVeryLongFileNamePrefix00001
AVeryLongFileNamePrefix12922
AVeryLongFileNamePrefix22112
AVeryLongFileNamePrefix33112
There is no ellipsis symbol. There are always two dots that can be paired with a dot in the name.funkymonk wrote: 2024-10-04, 09:47 UTCThe ellipsis "..." or ".." is probably the intuitive way to go. However, it eats up 2-3 chars (and there might even be filenames that indeed contain 2-3 dots in a row).
How about using a special char/indicator that (1) is visually striking, (2) cannot be used in filenames anyways, and (3) needs less space?
I don't think that one forbidden symbol instead of two dots will bring tangible benefits in terms of saving space. If we talk about the choice, then it could be *, ? or >, but I'm not sure that the others will approve of it, having been used to two dots for many years.
So what about the extension and the specified option? The file name can be as follows:
n.this_is_a_long_extension_don't_pay_attention_to_its_contents
Last edited by Fla$her on 2024-10-04, 13:39 UTC, edited 1 time in total.
Overquoting is evil! 👎
Re: Improve File Name Display by Cutting Characters in the Middle
So, I guess with a simple "alwaysShowLastChars=n", where n can be a number or a percentage, we could cover 99% of all cases and needs...
Re: Improve File Name Display by Cutting Characters in the Middle
2funkymonk
That doesn't answer my question.
That doesn't answer my question.
Overquoting is evil! 👎