[TC10.52 (at least, maybe previous versions too] Multiple folders in 'Search For' field of Search dialogue

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Helix751
Senior Member
Senior Member
Posts: 231
Joined: 2004-06-16, 21:16 UTC
Location: Chile

[TC10.52 (at least, maybe previous versions too] Multiple folders in 'Search For' field of Search dialogue

Post by *Helix751 »

The "Search For" field in the Search dialogue admits a multiple file specification, each entry separated by spaces (or semicolons).

But, when trying to specify multiple folders (directories), none are selected, no matter whether they are enclosed in double-quotes, separated by spaces or semicolons. More than one entry specified and none is/are recognized.

I'm trying to get a Search definition to match several folders (with the [X] Directory attribute set) for the "Define colors by file type"

Is this a bug or normal behavior?
Regards,
Sergio

TCmd license #12059
TC11.03x86/x64 | Win11 Pro
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC10.52 (at least, maybe previous versions too] Multiple folders in 'Search For' field of Search dialogue

Post by *petermad »

2Helix751
Put a dot after one of the dir names:

Code: Select all

 dir1. dir2 dir3
help wrote:When the search string contains a dot, Total Commander will look for the exact name match
You can also just start wit a dot:

Code: Select all

. dir1 dir2 dir3
notice:

Code: Select all

dir1. dir2 dir3
and

Code: Select all

. dir1 dir2 dir3
will find "dir1", "dir2" and "dir3"

but:

Code: Select all

dir1 dir2 dir3.
will find "dir1", "dir2", "dir3", "dir1 dir2 dir3" and "dir2 dir3""
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 4614
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.52 (at least, maybe previous versions too] Multiple folders in 'Search For' field of Search dialogue

Post by *white »

petermad wrote: 2022-10-31, 00:25 UTC notice:

Code: Select all

dir1. dir2 dir3
and

Code: Select all

. dir1 dir2 dir3
will find "dir1", "dir2" and "dir3"
Notice that

Code: Select all

dir1. dir2 dir3
will also find "dir1. dir2 dir3"

and

Code: Select all

. dir1 dir2 dir3
will also find ". dir1 dir2 dir3"

petermad wrote: 2022-10-31, 00:25 UTC but:

Code: Select all

dir1 dir2 dir3.
will find "dir1", "dir2", "dir3", "dir1 dir2 dir3" and "dir2 dir3""
No, it will not find "dir2 dir3"

To only find "dir1", "dir2" and "dir3", include a dot or wildcard and something that cannot be found.
Or add quotes around at least one folder name (while also including a dot or wildcard).
Examples:

Code: Select all

:? dir1 dir2 dir3
. "dir1" dir2 dir3
Or use a regular expression:

Code: Select all

^(dir1|dir2|dir3)$
Or use the Plugin tab and explicitly specify the conditions.
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC10.52 (at least, maybe previous versions too] Multiple folders in 'Search For' field of Search dialogue

Post by *petermad »

white wrote: 2022-10-31, 15:15 UTC
petermad wrote: 2022-10-31, 00:25 UTC but:

Code: Select all

dir1 dir2 dir3.
will find "dir1", "dir2", "dir3", "dir1 dir2 dir3" and "dir2 dir3""
No, it will not find "dir2 dir3"
Sorry, you are right.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48072
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.52 (at least, maybe previous versions too] Multiple folders in 'Search For' field of Search dialogue

Post by *ghisler(Author) »

Indeed the rules are that
1. When there are spaces and dots, TC will look for both the individual names separated by the spaces, and for the entire name
2. TC always assumes a dot at the end of a file name. So
dir1 dir2 dir3.
will find
dir1 dir2 dir3
because a dot is just assumed at the end. This is necessary so wildcards like
name.*
will also find files without an extension.
Author of Total Commander
https://www.ghisler.com
User avatar
Helix751
Senior Member
Senior Member
Posts: 231
Joined: 2004-06-16, 21:16 UTC
Location: Chile

Re: [TC10.52 (at least, maybe previous versions too] Multiple folders in 'Search For' field of Search dialogue

Post by *Helix751 »

Thanks for the tips! II didn't know about this "dot" search mode.

Another question derived from this:
When searching for dirs with space-separated names (LFNs), does it work to search for the whole name to enclose these in double quotes?

Code: Select all

. Dev Photos "11 Client POs" -AYRS
Here I need to search for specific names or parts of names:
Dev
Photos
"11 Client POs"
-AYRS
Regards,
Sergio

TCmd license #12059
TC11.03x86/x64 | Win11 Pro
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC10.52 (at least, maybe previous versions too] Multiple folders in 'Search For' field of Search dialogue

Post by *petermad »

Helix751 wrote: 2022-11-04, 22:25 UTC Thanks for the tips! II didn't know about this "dot" search mode.

Another question derived from this:
When searching for dirs with space-separated names (LFNs), does it work to search for the whole name to enclose these in double quotes?

Code: Select all

. Dev Photos "11 Client POs" -AYRS
Here I need to search for specific names or parts of names:
Dev
Photos
"11 Client POs"
-AYRS
You must use:

Code: Select all

*Dev* *Photos* "*11 Client POs*" *-AYRS*
for that, if the different parts can be anywhere in the file/folder name.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply