Search folders that contain txt files that contains a specific word
Moderators: Hacker, petermad, Stefan2, white
Search folders that contain txt files that contains a specific word
Hi to everyone, sorry for my bad english.
Is there a way in total commander to search and display only folders that contain text files that contain a specific word? For example, I want to see the list of folders that have a .txt file inside that contains the word 2023
I saw that I can find all the text files that contain the specific word, but I would like to have the list of folders and not of the files found
thanks in advance
Is there a way in total commander to search and display only folders that contain text files that contain a specific word? For example, I want to see the list of folders that have a .txt file inside that contains the word 2023
I saw that I can find all the text files that contain the specific word, but I would like to have the list of folders and not of the files found
thanks in advance
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search folders that contain txt files that contains a specific word
Unfortunately such a function would be terribly slow. It could be done with a plugin, but the user experience would be bad.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- jonathanpoulin
- Member
- Posts: 131
- Joined: 2020-12-19, 12:09 UTC
- Location: Saint-Marc-des-Carrières, QC Canada
- Contact:
Re: Search folders that contain txt files that contains a specific word
Mr. Ghisler, I have a similar use case. Which plugin(s) do you recommend for to achieve that?ghisler(Author) wrote: 2024-07-18, 13:41 UTC Unfortunately such a function would be terribly slow. It could be done with a plugin, but the user experience would be bad.
Thanks,
Jonathan Poulin
Jonathan Poulin
Re: Search folders that contain txt files that contains a specific word
I don't think that anything new is needed: You can just use the normal search for filemask und text and then all the files found copy into a list and pass it to an editor which uses regex to delete the file names and then removes all duplicate directory names. That should be quick and the list would be ready for further use.
However, I make it even easier and faster: After searching and "Feed to listbox", I press Ctrl+Right Arrow (or Ctrl+Left Arrow) on the relevant files and I am in one of the desired directories. You can repeat this as often as you like and even work with tabs... I mmyself uses this very very often...
Jou"For me no need of a Plugin and even not slow"be
However, I make it even easier and faster: After searching and "Feed to listbox", I press Ctrl+Right Arrow (or Ctrl+Left Arrow) on the relevant files and I am in one of the desired directories. You can repeat this as often as you like and even work with tabs... I mmyself uses this very very often...
Jou"For me no need of a Plugin and even not slow"be
- jonathanpoulin
- Member
- Posts: 131
- Joined: 2020-12-19, 12:09 UTC
- Location: Saint-Marc-des-Carrières, QC Canada
- Contact:
Re: Search folders that contain txt files that contains a specific word
Yes, I was thinking the same. We can do a lot of things with something like Notepad++. And, this is relatively easy to do, not a lot of steps. But, maybe not as effective compared to having a plugin that do it for us, IMHO. This would be more "TC-oriented".JOUBE wrote: 2024-07-18, 18:32 UTC I don't think that anything new is needed: You can just use the normal search for filemask und text and then all the files found copy into a list and pass it to an editor which uses regex to delete the file names and then removes all duplicate directory names. That should be quick and the list would be ready for further use.
However, I make it even easier and faster: After searching and "Feed to listbox", I press Ctrl+Right Arrow (or Ctrl+Left Arrow) on the relevant files and I am in one of the desired directories. You can repeat this as often as you like and even work with tabs... I mmyself uses this very very often...
Jou"For me no need of a Plugin and even not slow"be
Thanks,
Jonathan Poulin
Jonathan Poulin
Re: Search folders that contain txt files that contains a specific word
2jonathanpoulin
What do you want to do with these folders after finding them? Maybe it makes sense to write a script?
What do you want to do with these folders after finding them? Maybe it makes sense to write a script?
Overquoting is evil! 👎
Re: Search folders that contain txt files that contains a specific word
2rockberto
Hi,
try this in tool 'Everything' version 1.5.0.1383a (x64) - (please see my signature):
Windows 11 Pro (x64) Version 23H2 (OS Build 22631.3880)
TC 11.03 x64/x86 | 'Everything' 1.5.0.1383a (x64)
Search queries: Total Commander <=> 'Everything' <= Windows Search
Troubleshooting | Troubleshooting Information 1.5
Hi,
try this in tool 'Everything' version 1.5.0.1383a (x64) - (please see my signature):
- Everything Options - 1.5.0.1383a (x64) > Content >
Index file content > Include only folders: ... >
Include only files: *.txt (note the tooltip...) - Right-click on the column headings > Add Columns > Windows Property System > Folder name (System.ItemFolderNameDisplay) > OK
[The name of the column was translated by me and could also be different. The important thing is: System.ItemFolderNameDisplay]. - Search for: *.txt content:"word 2023"
- Click in the search result and press Ctrl + A
- Menu "File" > Copy Property > Folder name
- In the search box, overwrite the search query with: filelist1: <-- Attention: Do NOT paste this text via the clipboard! file-list:1
- Hold down the Ctrl key and click IN THE TEXT "filelist1:" in the search box -> the "Edit File List 1" window appears [empty].
- Press Ctrl+V to insert the folder names. Do NOT press the "OK" button now!
- Click on the "Export..."-button
- Save the file, e.g. with the name: "Folder_column-'Folder name'.efu" - File type: EFU 'Everything' File List (*.efu)
- Click on the "Cancel" button in the "Edit File List 1" window.
- Open the file "Folder_column-'Folder name'.efu" with a text editor, e.g. using the F4 key in Total Commander
(Configuration > Options... > Edit/View > Editor for F4).
Windows 11 Pro (x64) Version 23H2 (OS Build 22631.3880)
TC 11.03 x64/x86 | 'Everything' 1.5.0.1383a (x64)
Search queries: Total Commander <=> 'Everything' <= Windows Search
Troubleshooting | Troubleshooting Information 1.5
Re: Search folders that contain txt files that contains a specific word
thanks everyone for the replies.
I solved it this way: I first searched for all the .txt files that contained the keyword. I renamed the extension of these files. Then I searched for only the folders that contained the files with the new extension and moved the folders. Then I put the right extension back on the .txt files
I solved it this way: I first searched for all the .txt files that contained the keyword. I renamed the extension of these files. Then I searched for only the folders that contained the files with the new extension and moved the folders. Then I put the right extension back on the .txt files
Re: Search folders that contain txt files that contains a specific word
Clever solutionrockberto wrote: 2024-07-19, 15:11 UTC thanks everyone for the replies.
I solved it this way: I first searched for all the .txt files that contained the keyword. I renamed the extension of these files. Then I searched for only the folders that contained the files with the new extension and moved the folders. Then I put the right extension back on the .txt files

Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
- jonathanpoulin
- Member
- Posts: 131
- Joined: 2020-12-19, 12:09 UTC
- Location: Saint-Marc-des-Carrières, QC Canada
- Contact:
Re: Search folders that contain txt files that contains a specific word
2Fla$her
Yes. There a multiple ways to do it. The solutions JOUBE and rockberto proposed are one of those.
Yes. There a multiple ways to do it. The solutions JOUBE and rockberto proposed are one of those.
Thanks,
Jonathan Poulin
Jonathan Poulin
Re: Search folders that contain txt files that contains a specific word
2jonathanpoulin
No, those suggestions are not about what to do with the found folders. That's why I've pointed to a script that doesn't require extra steps.
No, those suggestions are not about what to do with the found folders. That's why I've pointed to a script that doesn't require extra steps.
Overquoting is evil! 👎
Re: Search folders that contain txt files that contains a specific word
2rockberto
How did you do this part - and come out with a list of folders?Then I searched for only the folders that contained the files with the new extension...
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Search folders that contain txt files that contains a specific word
FileMask.wdx, maybe?petermad wrote: 2024-07-20, 18:48 UTC How did you do this part - and come out with a list of folders?
FileMask.ini:
Code: Select all
[DirMask]
NEW=*.new
filemask | DirMask | > | 0 | NEW [▾]
Overquoting is evil! 👎
Re: Search folders that contain txt files that contains a specific word
Search for the filesrockberto wrote: 2024-07-16, 08:48 UTC I can find all the text files that contain the specific word,
but I would like to have the list of folders and not of the files found
- in the search result, press Ctrl+C
- paste into a text editor with RegEx s&r
- to get
d:\Test ordner\d\TOTALCMD.CHM
d:\Test ordner\e\TOTALCMD.CHM
In the editor
- search for: (.+)\\.+
- replace with: \1 (or $1)
- to get
d:\Test ordner\d
d:\Test ordner\e
Save the result as C:\Temp\_myLoadlist.txt
(if you only wanted the list of the folders, you can stop here)
If you want to list the folders in TC to work with them somehow:
Create a user defined command in usercmd.ini
[em_LoadList]
cmd=LOADLIST C:\Temp\_myLoadlist.txt
Execute loadlist
- go to the "main folder"
- in TCs command line type em_loadlist and enter (later use Ctrl+E to re-execute)
(instead of a UDC, you may want to create a button with that command)
Work with the so found folders
- use Ctrl+T to duplicate the "search result"-tab
- now work with that new tab to do your things, use Ctrl+W to close that tab after work done
- for the next folder, open again a new tab from the "search result"-tab
HINT: once set up, you can always reuse it for the next case.
Needs "10.03.21 Release Total Commander 10.00 public beta 1" or newer.
01.11.20 Added: New internal command LOADLIST listfilename loads list of files/folders from text file.
There must be one name per line. If no path is provided, the current directory is assumed.
File details are retrieved automatically (32/64)
Instead of using LOADLIST, you also can use this older approach:
1. Make a search
with "Search for" left empty,
and "Search in" containing:
@c:\path to your\filelist.txt
(one file, folder or path per line)
2. Click on "Feed to listbox"
That way you get a search result from the current file system.
Next double the tab by using Ctrl+T so you can go back to the search result.