Quicksearch of folders containing "both" types of files

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Quicksearch of folders containing "both" types of files

Post by klownboy »

I can do a SC quicksearch to look for folders which contain "dbits" files with:
quicksearch("prop:#contains.*.dbits:1", "I:\Temp\");

and I can do a quciksearch to find folders containing ini or dbits files:
quicksearch("prop:#contains.*.ini:1;prop:#contains.*.dbits:1", "I:\Temp\");

The last search finds any folder which contains either "ini" or "dbits". Is there another syntax to find folders that contain "both" files, "ini" and "dbits"? Thanks..

Norn
Posts: 522
Joined: 24 Oct 2021 16:10

Re: Quicksearch of folders containing "both" types of files

Post by Norn »

Code: Select all

prop:#contains.*.jpg:1 and prop:#contains.*.png:1

Code: Select all

text quicksearch("prop:#contains.*.ini:1 and prop:#contains.*.dbits:1", "I:\Temp\");
?
Windows 11 24H2 @100% 2560x1440

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Quicksearch of folders containing "both" types of files

Post by klownboy »

Thanks Norm, I forgot that the ";" between the two props is equivalent to "OR" and using "AND" will result in seeing only folders that have both file extensions. Thanks again.

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Quicksearch of folders containing "both" types of files

Post by klownboy »

I have another syntax question similiar to the above, but not the same. In this case I'm initially looking for all folders which have ini OR dbits files. They don't have to have "both" types since I'm looking for stray thumbnail ini files as well as stray dbits file (one type missing its mate).

So, I first get those folders and yes, in the case of ini files, there could be quite a few that have nothing to do with thumbnails. The situation is "Resolve cache path from current" checked in thumbnail Configuration so thumbnail caches will be located in any folder containing thumb-able image type files. After obtaining $folders, I narrow it down to only ini files containing the word "SizeDbits" which is something specific to thumbnail ini's and also get the list of dbits files. I'm having trouble with the syntax on combining that search for $data in one quicksearch. :

Code: Select all

  elseif($CacheDir == "") {
    $paths = $sel_drive . <crlf> . quicksearch("/d /a", $sel_drive); //works
    $folders = quicksearch("prop:#contains.*.ini:1 OR prop:#contains.*.dbits:1 /n /a", $paths); //works
    $data =quicksearch("*.ini /contents=SizeDbits", $folders) . <crlf> . quicksearch("*.dbits", $folders); //works
The above dual quicksearch for $data works and I can use it, but I've tried literally a dozen different ways in attempt to use a single quicksearch with no luck. Quicksearch syntax and me don't get along. Any help would be appreciated. Thanks.

Code: Select all

$data3 = quicksearch("* /types=ini;dbits AND /contents=SizeDbits", $folders);   //doesn't work
$data2 = quicksearch("*.dbits OR /types=ini /contents=SizeDbits", $folders);   //doesn't work
$data7 = quicksearch("*.ini;*.dbits OR /contents=SizeDbits", $folders);   //doesn't work
$data5 = quicksearch("* /types=dbits OR *.ini /contents=SizeDbits", $folders);   //doesn't work

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Quicksearch of folders containing "both" types of files

Post by LittleBiG »

I am sorry if it won't work, because I am not at my computer at the moment. I would try something like this:
In the pattern part of quicksearch: "*.dbits OR (*.ini AND cont:SizeDbits)"
Of course I have my doubts, but I would give it a try.

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Quicksearch of folders containing "both" types of files

Post by klownboy »

Thanks LittleBig, that was the right combo. Funny thing, I had tried parenthesis on the ini section in some attempts not listed above, but I was not quite there:

Code: Select all

   $data =quicksearch("(* /types=ini AND /contents=SizeDbits) OR *.dbits", $folders);
   $data =quicksearch("(* /types=ini AND lent: 32) OR *.dbits", $folders);
Evidently it didn't like /types = ini along with /contents=SizeDbits

This also worked since I was looking for ini hash files with a 32 character name:

Code: Select all

   $length = "????????????????????????????????";
   $data4 =quicksearch("$length.ini OR *.dbits /a /n", $paths);
I'm still wondering about the lent: pattern switch. It looks like it's only available on the "Find Files Tab" of the Info Panel and not valid for SC quicksearch. It is referred to in Quicksearch Help under Search Pattern Prefixes ,"Find Files by Contained Characters". The length argument would be a nice option to have available. It may be because all the patterns in the GUI Find Files Tab are under name and this is under contents OR more than likely I'm not applying it correctly :) Thanks again.

Post Reply