I want to search a tree structure for any TEXT file that contains two specific words but they must be in the same line. Is there a way to achieve that using "Find files" dialog?
EDIT: I have had this need in the past too, so if it's not directly supported, i would like to add it as a wish.
How to search files for two words in the same line
Moderators: Hacker, petermad, Stefan2, white
How to search files for two words in the same line
- Wanderer -
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
Re: How to search files for two words in the same line
wanderer,
Well, regex is limited to one line, so you can do
and then
If there was a tc.content field, one could chain them using OR, alas, I am not aware of a WDX which would simply return the content of a file.
HTH
Roman
Well, regex is limited to one line, so you can do
Code: Select all
word1.*word2
Code: Select all
word2.*word1
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: How to search files for two words in the same line
Just tried it. Many thanks Hacker, it worked fine. And it also works the same way in the Lister!
Last edited by wanderer on 2021-11-19, 14:47 UTC, edited 1 time in total.
- Wanderer -
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
Re: How to search files for two words in the same line
Code: Select all
word1.*word2
If you want to match word2 then word1 you will have to also add the expression like :
Code: Select all
(word1.*word2)|(word2.*word1)

Re: How to search files for two words in the same line
Well, my case was 1-way only (word1.*word2) but thanks for the OR reminder nsp.
- Wanderer -
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.