Finding a folder without specific file?

English support forum

Moderators: white, Hacker, petermad, Stefan2

wOxxOm
Junior Member
Junior Member
Posts: 12
Joined: 2004-09-25, 17:47 UTC

Post by *wOxxOm »

yes, please
User avatar
chrizoo
Senior Member
Senior Member
Posts: 349
Joined: 2008-03-12, 02:42 UTC

Post by *chrizoo »

Lefteous wrote:2Valery_Kondakoff
Some time ago I added a field named "Content" to my content plug-in "Directory". It's intended to display the files contained in a directory in a tooltip. This field cannot be used in the search in a meaningful way as its length is quite limited. I'm thinking adding another field with support for the search function. Are you interested?
Very good idea. Please post here if there are any news.
Theodecarvalho
New Member
New Member
Posts: 1
Joined: 2021-05-26, 15:21 UTC

Re: Finding a folder without specific file?

Post by *Theodecarvalho »

Hello.

I need to search directory without a specific filetype, display folder, not files.

Example: Search folders in Mp3 folder without jpg files, returning folder names.

Is this improved in Total Commander?

Thanks.
isidro
Junior Member
Junior Member
Posts: 96
Joined: 2006-03-21, 04:39 UTC
Location: argentina

Re: Finding a folder without specific file?

Post by *isidro »

Find dirs without Folder.jpg in it:

1) You will need to install and open TEXTPAD editor.
2) In TC (Total Commander), generate list of ALL directories:
Alt+F7 (Search) *.* [Advanced Tab] [Select Attrib] [Check Directory]; [Start Search]; [Add to list]
3) Copy list of all dirs:
TC: Select, Invert selection; Select, Copy names and paths to Clipboard
Textpad: Paste directory list, press enter to create a NewLine
4) TC, generate list of ALL Folder.jpg:
Alt+F7 (Search) Folder.jpg [Start Search]; [Add to list]
5) Copy list of all Folder.jpg:
TC: Select, Invert selection; Select, Copy names and paths to Clipboard
Textpad: Paste (Folder.jpg) list, press enter to create a NewLine
on TEXTPAD:
6) F9 (sort) From 1, Length 999, case insensitive, OK
7) F8 (replace) [Find what:]
^(.+)\r\1Folder\.jpg\r
[Replace With:] (empty)
[Regular Expression]: CHECK
[Replace All]

That will leave a list of all DIRs without Folder.jpg, it may fail when there are subdirectories, which may be sorted between parent dir and correspondant Folder.jpg.
We must sort to group all directories with it's correspondant Folder.jpg together so Replace will be able to find and eliminate them.
Regular expression detailed explanation:
^ searchs from the begining of line
( ) marks subexpression
.+ the dot finds any char, the plus sign repeats previous one or more times, basically .+ will match everything
\r new line
\1 will match first marked subexpression (so will match the line which contains full path, just marked before) but now we add: Folder\.jpg\r (the dot must be escaped) and another new line. We replace all that with nothing, so remaining lines are the directories which do not have Folder.jpg on it.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6482
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Finding a folder without specific file?

Post by *Horst.Epp »

Thats a simple job using Everything in TC.
Go to your mp3 base folder and use the following TC search:

ed:folder: !child:*.jpg
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
Post Reply