Search for folders containing both *.txt and *.jpg

General discussion related to "Everything".
Post Reply
w64bit
Posts: 63
Joined: Wed Jan 09, 2013 9:06 am

Search for folders containing both *.txt and *.jpg

Post by w64bit » Sun May 31, 2020 1:49 pm

How can I search for folders containing *.txt and *.jpg?
It is not necessary to be only these file types inside the folder.
I want to display only the folders directly containing those file types. If these files are in a subfolder, the folder should not be listed.
Thank you
Last edited by w64bit on Mon Jun 01, 2020 11:23 am, edited 1 time in total.

therube
Posts: 2573
Joined: Thu Sep 03, 2009 6:48 pm

Re: Search for folders containing *.txt and *.jpg

Post by therube » Sun May 31, 2020 2:34 pm

While not "right", this might be close enough,
child:.txt | child:.jpg
?

(There could be false results, like, test.txt.doc & txt [with no extension] & ...)

If these files are in a subfolder, the folder should not be listed.
Not following what you mean by that, but maybe
parents:
would work into the equation?

w64bit
Posts: 63
Joined: Wed Jan 09, 2013 9:06 am

Re: Search for folders containing both *.txt and *.jpg

Post by w64bit » Sun May 31, 2020 2:55 pm

folder1 > folder2 >>> folder3 >>>> folder4 > file4.mp4
......... > file1.txt | > file2.gif | > file3.txt
......... > file1.jpg | > file2.tif | > file3.jpg
......... > file1.png | xxxxxxxx | > file3.avi

folder1 contains folder2 + all files1
folder2 contains folder3 + all files2
folder3 contains folder4 + all files3
folder4 contains file4

the result should be folder1 + folder3
Last edited by w64bit on Mon Jun 01, 2020 11:23 am, edited 1 time in total.

NotNull
Posts: 2109
Joined: Wed May 24, 2017 9:22 pm

Re: Search for folders containing *.txt and *.jpg

Post by NotNull » Sun May 31, 2020 8:51 pm

And @therube's suggestion ( child:*.txt | child:*.jpg ) didn't give you the results you were looking for?

w64bit
Posts: 63
Joined: Wed Jan 09, 2013 9:06 am

Re: Search for folders containing both *.txt and *.jpg

Post by w64bit » Mon Jun 01, 2020 11:19 am

No. It listed all folders containing only JPG or only TXT.
The scope is to display only the folders containing both JPG and TXT.

void
Site Admin
Posts: 5458
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search for folders containing both *.txt and *.jpg

Post by void » Mon Jun 01, 2020 11:24 am

Please try the following search:
child:*.txt child:*.jpg

w64bit
Posts: 63
Joined: Wed Jan 09, 2013 9:06 am

Re: Search for folders containing both *.txt and *.jpg

Post by w64bit » Mon Jun 01, 2020 12:43 pm

Yesss. Thank you very much.

therube
Posts: 2573
Joined: Thu Sep 03, 2009 6:48 pm

Re: Search for folders containing both *.txt and *.jpg

Post by therube » Mon Jun 01, 2020 8:07 pm

(Oh, I OR'd it.)

Post Reply