File selection difference: Direct use vs. Predefined filter
Moderators: Hacker, petermad, Stefan2, white
File selection difference: Direct use vs. Predefined filter
For selecting files it is possible to use the Num + key on the numerical block and enter the selection you want. Alternatively you can define and store a filter to be used in the selection dialog.
I observed that the selection is different depending on the chosen method. When using a predefined filter not all files are included in the selection. Following example should illustrate the behaviour I observed.
My question: Is this intended behaviour, and where can I find a description to this? I searched but could not find any hint to this. I observed this in all version I currently use: TCMD 8.* and 7.52
--------
Example: In one place I have two directories (Dir1 and Dir2) and two files (File1 and File2).
1) In the file selection dialog (on pressing Num +) I enter "File1 Dir1". As result the directory Dir1 and the file File1 are selected.
2) In the file selection dialog I select 'Define...', enter "File1 Dir1" and save the filter giving the name Mask1. On using the selection dialog I select Mask1 in the list and press OK. Now I get the error "No matches found!"
There is no difference in case I use a semicolon as separation character.
3) In the file selection dialog I select 'Define...', enter "File1* Dir1*" and save the filter giving the name Mask2. On using the filter Mask2 directory Dir1 and file File1 are selected. The only difference is, that now I appended "*" to the end of each name. This works fine in this situation but fails, if there is another name with the same beginning (e.g. Dir1-old). In this situation more than expected gets selected. How can I avoid this?
Thanks for any hints
I observed that the selection is different depending on the chosen method. When using a predefined filter not all files are included in the selection. Following example should illustrate the behaviour I observed.
My question: Is this intended behaviour, and where can I find a description to this? I searched but could not find any hint to this. I observed this in all version I currently use: TCMD 8.* and 7.52
--------
Example: In one place I have two directories (Dir1 and Dir2) and two files (File1 and File2).
1) In the file selection dialog (on pressing Num +) I enter "File1 Dir1". As result the directory Dir1 and the file File1 are selected.
2) In the file selection dialog I select 'Define...', enter "File1 Dir1" and save the filter giving the name Mask1. On using the selection dialog I select Mask1 in the list and press OK. Now I get the error "No matches found!"
There is no difference in case I use a semicolon as separation character.
3) In the file selection dialog I select 'Define...', enter "File1* Dir1*" and save the filter giving the name Mask2. On using the filter Mask2 directory Dir1 and file File1 are selected. The only difference is, that now I appended "*" to the end of each name. This works fine in this situation but fails, if there is another name with the same beginning (e.g. Dir1-old). In this situation more than expected gets selected. How can I avoid this?
Thanks for any hints
You can use the file mask:
to get the desired outcome. This will works for everything but files and folders with only on character in the name.
Code: Select all
dir1 file1 |?
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: File selection difference: Direct use vs. Predefined fil
You can find help by clicking the Help button in the Num + dialog and by clicking the Help button in the Define selection dialog. Yes the differences are intentional. Defined selections are actually the same as saved searched. Using saved searches in the Num + dialog was added later.sevem wrote:For selecting files it is possible to use the Num + key on the numerical block and enter the selection you want. Alternatively you can define and store a filter to be used in the selection dialog.
I observed that the selection is different depending on the chosen method. When using a predefined filter not all files are included in the selection. Following example should illustrate the behaviour I observed.
My question: Is this intended behaviour, and where can I find a description to this? I searched but could not find any hint to this.
By putting double quotes around the file names. Indeed, this is not clearly mentioned in the Help.sevem wrote:3) In the file selection dialog I select 'Define...', enter "File1* Dir1*" and save the filter giving the name Mask2. On using the filter Mask2 directory Dir1 and file File1 are selected. The only difference is, that now I appended "*" to the end of each name. This works fine in this situation but fails, if there is another name with the same beginning (e.g. Dir1-old). In this situation more than expected gets selected. How can I avoid this?
For names without spaces and no extension, you can also append a dot to the end of the name to force exact matching.
This will not help in this case...By putting double quotes around the file names
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
You are right.petermad wrote:This will not help in this case...By putting double quotes around the file names
It seems when a dot (.), question mark (?) or asterisk (*) is somewhere in the search field, exact matching is turned on, space and semi colon become separators (1) and the pipe symbol becomes a separator for an exclude mask.
So you can simply add a space and a dot (also search for an empty file name). Or append a dot to one of the file names. Or add a search for some string that is not in any file name and includes dot, question mark or asterisk.
Code: Select all
Dir1 File1 "File name" .
Dir1. File1 "File name"
Dir1 File1 "File name" some.string
Dir1 File1 "File name" force_exact_matching?
Dir1 File1 "File name" *blablabla
Edit:
(1) The whole search string is always searched also. So searching for "test text.txt" (without the quotes) finds "test", "test.txt" and "test test.txt".
Last edited by white on 2014-01-12, 16:28 UTC, edited 3 times in total.
So searching forwhite wrote:It seems when a dot (.), question mark (?) or asterisk (*) is somewhere in the search field, exact matching is turned on, space and semi colon become separators and the pipe symbol becomes a separator for an exclude mask.
Code: Select all
File1|windows\
I believe this to be a bad thing.petermad wrote:You can use the file mask:to get the desired outcome. This will works for everything but files and folders with only on character in the name.Code: Select all
dir1 file1 |?
Searching for
Code: Select all
this file
And searching for
Code: Select all
this file|?
In my opinion it would have been better if the pipe symbol would always be interpreted as separator between search string and exclude string. And that the exclude string would not influence the interpretation of the search string and vice versa.
Regretfully, I don't think Mr. Ghisler will be willing to change this (because it will break compatibility with previous versions of Total Commander).
Yes, and that is exactly what sevem is asking for, I believewill search files with exact file name "this" or "file"
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Thanks a lot for your help.
I did not think that there is such a deep story behind. For a long time I could live with the 'wildcard-solution' (with *). This stopped working when I had names that had the same beginning; this initiated my question.
And yes, I just was looking for a solution that searches for exact names.
I did not think that there is such a deep story behind. For a long time I could live with the 'wildcard-solution' (with *). This stopped working when I had names that had the same beginning; this initiated my question.
And yes, I just was looking for a solution that searches for exact names.