How to Search for File Name and Folder Name at the Same Time

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
mikeshick
Posts: 124
Joined: 06 Jul 2020 10:28

How to Search for File Name and Folder Name at the Same Time

Post by mikeshick »

How can i search for files of particular name within folders of a particular name?

Thanks.
Last edited by mikeshick on 15 Jul 2020 07:20, edited 1 time in total.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: How to Search for File Name and Folder Name at the Same Time

Post by highend »

By adding them |-separated to Location: and using a boolean OR-combined search in Name:?
One of my scripts helped you out? Please donate via Paypal

mikeshick
Posts: 124
Joined: 06 Jul 2020 10:28

Re: How to Search for File Name and Folder Name at the Same Time

Post by mikeshick »

Sorry, I don't understand your answer. Could you explain further, if you don't mind/

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: How to Search for File Name and Folder Name at the Same Time

Post by highend »

F1 - Main Topics - Info Panel - Find Files Tab

explains boolean and multiple location searches
One of my scripts helped you out? Please donate via Paypal

RalphM
Posts: 1932
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: How to Search for File Name and Folder Name at the Same Time

Post by RalphM »

AFAIK the OP's wish (find certain files within certain folders) cannot be done without scripting but as highend pointed out, you could do a boolean AND search for both names and then check the results.

If you are looking for a file named test2 in a folder named test1, you'd search for both names test1 AND test2 in location and it should bring up your result but it would also show a file test1 in a folder named test2.

I hope this made it somewhat clearer.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: How to Search for File Name and Folder Name at the Same Time

Post by highend »

A script isn't necessary. To get exact matches you could also use a (name:... AND path:...) OR (name:... AND path:...) ... combined pattern.

E.g.: :(abc.txt AND path:R:\\tst\\1) OR (name:def.txt AND path:R:\\tst\\2)
Which finds abc.txt only in the 1 subfolder and def.txt only in the 2 subfolder but NOT abc.txt in 2, even if it exists there.

But these solutions require a large amount of typing (which ofc could be avoided by coding a script that translates the search terms into this pattern type)
One of my scripts helped you out? Please donate via Paypal

Post Reply