How to find only folders which contain file with text.

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
olesio
Junior Member
Junior Member
Posts: 54
Joined: 2009-01-22, 15:29 UTC
Location: Poland

How to find only folders which contain file with text.

Post by *olesio »

Hello. Using Total Commander and Alf+F7 dialog I want to search my Delphi projects which only contain config files with "FOR_WINAPI" text. Please tell me how to do this. I typed *.cfg as searched pattern and following text to find FOR_WINAPI, but in advanced tab I can only set attributes as Folder, but when *.cfg is typed I cannot find anything. I want to get only folder names in results to copy whole subdirectories to another directory. I tried with "tc" plugin settings but nothing works as I want. Please give me some example. Thanks in advice and sorry for my bad English.
Best regards: olesio
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Script wdx?
olesio
Junior Member
Junior Member
Posts: 54
Joined: 2009-01-22, 15:29 UTC
Location: Poland

Post by *olesio »

Thank you for reply, but can you (or some one else) give me example of *.vbs script which search *.cfg files for text FOR_WINAPI and return only name of directories which contain file mentioned above with this text? Example *.vbs files give me nothing. I do not have vbs knowledge.
Best regards: olesio
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

2olesio

Sometimes i need to get parent dirs of file's full path, so i have created a little program to do that, try it

How to use:
1- Search for *.cfg contains FOR_WINAPI
2- Feed the result to the listbox
3- Press Ctrl+A to select all files
4- Execute the command cm_CopyFullNamesToClip
5- Run the program "get_parent_dirs.exe" which will remove the file names and put the result to the clipboard
6- Run Notepad and press Ctrl+V
olesio
Junior Member
Junior Member
Posts: 54
Joined: 2009-01-22, 15:29 UTC
Location: Poland

Post by *olesio »

I can write similar program by myself, but I wanted get result as dirs to speed up preparing of copy process. I finally uses makebat.wcx plugin and generate following bat with command for searched results:

Code: Select all

@xcopy /I "%D" D:\!%D"
Later I replaces \" with nothing and D:\! and second patch to "D:\!\<outputdir>". But maybe in future version of Total Commander this kind of operations will be easyiest and allow be done without plugins. But if anyone have idea how to do this with script.wdx please let me know.
Best regards: olesio
User avatar
white
Power Member
Power Member
Posts: 5979
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

olesio wrote:But maybe in future version of Total Commander this kind of operations will be easyiest and allow be done without plugins.
You can use the Multi-Rename Tool to make batch files instead of the Makebat plugin. So it is possible to do it without using plugins. However it's still not very convenient.
olesio
Junior Member
Junior Member
Posts: 54
Joined: 2009-01-22, 15:29 UTC
Location: Poland

Post by *olesio »

I "digging" up this topic, beacuse I hadled by myself and make wdx plugin which work like I wanted to. I pasted source and description in my second post in this thread: http://www.ghisler.ch/board/viewtopic.php?p=227781#227781 maybe some get this infos useful.
Best regards: olesio
Post Reply