ALT-F7 Find filenames based on multiple words. OR AND

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
nn1k3
Member
Member
Posts: 141
Joined: 2007-02-06, 16:59 UTC

ALT-F7 Find filenames based on multiple words. OR AND

Post by *nn1k3 »

I finally realized how to search for multiple words in filenames.

Code: Select all

1) OR. Find files with filenames containing "cat" or "dog" or "mouse" or both:
	*cat* *dog* *mouse*

2) AND. Search for filenames containing "cat" and "dog":
	*cat*dog* *dog*cat*

3) AND. Search for filenames containing "cat" and "dog" and "mouse":
*cat*dog*mouse *dog*cat*mouse *cat*mouse*dog* *dog*mouse*cat* *mouse*cat*dog *mouse*dog*cat*
Example 1 is nice. Example 3 is ugly - better to just use Locate32.

This might be of general interest. Apologies if this is old news, or if I am mistaken.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Alt+F7, Plugins tab, choose OR/AND and set:

Code: Select all

tc.name contains cat
tc.name contains dog
tc.name contains mouse
User avatar
nn1k3
Member
Member
Posts: 141
Joined: 2007-02-06, 16:59 UTC

The Plugins tab in Find File .... AND/OR/NOT?

Post by *nn1k3 »

I am very grateful to MVV for showing me the advantage of using the Plugins tab of Find File.

QUESTION: How would I do a complicated search for filenames that combines AND, OR, and NOT?

Example: I have four files in a folder: cat.txt, cats.txt, dog.txt, wrongfile.txt
I want Find Files to return only cat.txt and dog.txt.
How would I do that?

You know that this won't work because it also returns wrongfile.txt:
tc.name contains cat, tc.name contains dog, tc.name !contains cats

I'll use regex if necessary but I doubt that would help.
Locate32 would work but I want to use TC's feed-to-listbox.
Lefteous might suggest using Find File again on the listbox result. The downside is that I would lose my first search setup.
User avatar
white
Power Member
Power Member
Posts: 6016
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: The Plugins tab in Find File .... AND/OR/NOT?

Post by *white »

nn1k3 wrote:I am very grateful to MVV for showing me the advantage of using the Plugins tab of Find File.

QUESTION: How would I do a complicated search for filenames that combines AND, OR, and NOT?

Example: I have four files in a folder: cat.txt, cats.txt, dog.txt, wrongfile.txt
I want Find Files to return only cat.txt and dog.txt.
How would I do that?

You know that this won't work because it also returns wrongfile.txt:
tc.name contains cat, tc.name contains dog, tc.name !contains cats
Combine with: (*) AND (all match)
tc.name regex cat|dog, tc.name !contains cats
User avatar
nn1k3
Member
Member
Posts: 141
Joined: 2007-02-06, 16:59 UTC

Post by *nn1k3 »

User "White" answered my question - thanks!

FYI I found that I could save White's search and it shows up in wincmd.ini [searches] as

white_plugin=tc.name regex cat|dog & tc.name !contains cats

That is no surprise to most of you, but some may benefit.
Post Reply