How to search through multiple directories and list folders that don't contain a specific file type?
Moderators: Hacker, petermad, Stefan2, white
How to search through multiple directories and list folders that don't contain a specific file type?
How to search through multiple directories and list folders that don't contain a specific file type?
Is there a plugin to find folders that don't contain files with a specific extension or I can achieve this using regular expressions?
Is there a plugin to find folders that don't contain files with a specific extension or I can achieve this using regular expressions?
Re: How to search through multiple directories and list folders that don't contain a specific file type?
You can use |, so to find all folders that don't have any png files in them
Open the search and press F1 or the help button for some more examples with |
Code: Select all
|*.png
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Re: How to search through multiple directories and list folders that don't contain a specific file type?
For example, when using the 'Everything' tool, the search in Total Commander is as follows --> field "Search for":
Explanation:
Windows 11 Pro (x64) Version 22H2 (OS build Build 22621.2134)
TC 11.00 x64/x86 | Search queries: TC <=> 'Everything'
'Everything' 1.5.0.1355a (x64) | 'Everything' 1.4.1.1024 (x64)
Code: Select all
ev:folder: !child:*.jpg
Code: Select all
*.jpg = Specific file type
ev: Total Commander parameter, to be able to use the parameters of tool 'Everything' in Total Commander.
folder: Modifier, match folders only.
! NOT
child: https://www.voidtools.com/forum/viewtopic.php?f=12&t=10176#child
Windows 11 Pro (x64) Version 22H2 (OS build Build 22621.2134)
TC 11.00 x64/x86 | Search queries: TC <=> 'Everything'
'Everything' 1.5.0.1355a (x64) | 'Everything' 1.4.1.1024 (x64)
Re: How to search through multiple directories and list folders that don't contain a specific file type?
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: How to search through multiple directories and list folders that don't contain a specific file type?
Here's the situation:
I have a directory path: c:\temp\, which contains 5 subfolders named dir1, dir2, dir3, dir4, and dir5. Among these subfolders, I've placed some PNG files only in dir1, dir3, and dir5, while dir2 and dir4 remain empty.
When I utilize the native Total Commander search query *.png to find all folders containing PNG files, the search results are as expected:
[3 files and 0 directories found]
c:\temp\dir1\001.png
c:\temp\dir3\003.png
c:\temp\dir5\005.png
However, the challenge arises when I attempt a search query |*.png to list folders that do not have any PNG files inside. The search results I get are quite different from what I anticipated:
[0 files and 5 directories found]
[c:\temp\dir1]
[c:\temp\dir2]
[c:\temp\dir3]
[c:\temp\dir4]
[c:\temp\dir5]
This outcome isn't aligned with my expectations. Ideally, I should have received:
[0 files and 2 directories found]
[c:\temp\dir2]
[c:\temp\dir4]
As you can see, my goal is to identify folders that lack a specific file type using Total Commander's native search query or possibly a plugin such as FileInDir or tc plugin.
Thank you in advance for taking the time to read my query and offer your valuable advice.
I have a directory path: c:\temp\, which contains 5 subfolders named dir1, dir2, dir3, dir4, and dir5. Among these subfolders, I've placed some PNG files only in dir1, dir3, and dir5, while dir2 and dir4 remain empty.
When I utilize the native Total Commander search query *.png to find all folders containing PNG files, the search results are as expected:
[3 files and 0 directories found]
c:\temp\dir1\001.png
c:\temp\dir3\003.png
c:\temp\dir5\005.png
However, the challenge arises when I attempt a search query |*.png to list folders that do not have any PNG files inside. The search results I get are quite different from what I anticipated:
[0 files and 5 directories found]
[c:\temp\dir1]
[c:\temp\dir2]
[c:\temp\dir3]
[c:\temp\dir4]
[c:\temp\dir5]
This outcome isn't aligned with my expectations. Ideally, I should have received:
[0 files and 2 directories found]
[c:\temp\dir2]
[c:\temp\dir4]
As you can see, my goal is to identify folders that lack a specific file type using Total Commander's native search query or possibly a plugin such as FileInDir or tc plugin.
Thank you in advance for taking the time to read my query and offer your valuable advice.
Re: How to search through multiple directories and list folders that don't contain a specific file type?
As I said: It should work with the FileInDir plugin set toNote that wildcards should be omitted here. You might want to adapt the search term to your needs, e.g. leaving the leading dot out, maybe change the operator to regex or similar.
[EDIT]
Operator changed from != to !contains.
[/EDIT]
Regards
Dalai
Code: Select all
fileindir | DirFiles | !contains | .png
[EDIT]
Operator changed from != to !contains.
[/EDIT]
Regards
Dalai
Last edited by Dalai on 2023-08-20, 15:04 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: How to search through multiple directories and list folders that don't contain a specific file type?
Alt+Shift+F7: Find Files (separate) > Tab "Plugins"
Click on button "Start search".
Plugin "FileInDir 2.0.0.2" | Plugin "FileX" - Download FileX23.zip
A double click in Total Commander(!) on the .zip file starts the plugin installation...
Code: Select all
☑️ Search in plugins ◉ OR (any match) <-- !!
Plugin: fileindir
Property: DirFiles
OP: !contains
Value: .png (and NOT *.png!)
Click on button "More rules" ...
Plugin: filex
Property: EmptyDir
OP: =
Value: Yes
Plugin "FileInDir 2.0.0.2" | Plugin "FileX" - Download FileX23.zip
A double click in Total Commander(!) on the .zip file starts the plugin installation...
Re: How to search through multiple directories and list folders that don't contain a specific file type?
Code: Select all
☑️ Search in plugins ◉ OR (any match) <-- !!
Plugin: fileindir
Property: DirFiles
OP: !contains
Value: .png (and NOT *.png!)
Click on button "More rules" ...
Plugin: filex
Property: EmptyDir
OP: =
Value: Yes
Re: How to search through multiple directories and list folders that don't contain a specific file type?
I'm pleased.

Thanks to Dalai for pointing out the plugin "FileInDir".
Re: How to search through multiple directories and list folders that don't contain a specific file type?
Code: Select all
☑️ Search in plugins ◉ AND (all match)
Plugin: tc
Property: ext
OP: !contains
Value: png
"More rules" ...
Plugin: filex
Property: EmptyDir
OP: =
Value: Yes

Thank you all for your help!