How to find only folders which contain file with text.
Moderators: Hacker, petermad, Stefan2, white
How to find only folders which contain file with text.
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
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
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
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
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:
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.
Code: Select all
@xcopy /I "%D" D:\!%D"
Best regards: olesio
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 wrote:But maybe in future version of Total Commander this kind of operations will be easyiest and allow be done without plugins.
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