searching path in files
Moderators: Hacker, petermad, Stefan2, white
searching path in files
I want to search a path instead of word in section search word
for example C:\windows\system32
when I want to search that in my files I always get nothing even when I create test.txt and put a C:\windows\system32 in it.
it doesn't find that string in test.txt
for example C:\windows\system32
when I want to search that in my files I always get nothing even when I create test.txt and put a C:\windows\system32 in it.
it doesn't find that string in test.txt
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: searching path in files
No problem here.
Text "C:\windows\system32" is found in test.txt
- All fields empty
- Find Text= C:\windows\system32
[x] ANSI charset (Windows)
[x] Unicode UTF-16
Text "C:\windows\system32" is found in test.txt
- All fields empty
- Find Text= C:\windows\system32
[x] ANSI charset (Windows)
[x] Unicode UTF-16
#5767 Personal license
Re: searching path in files
Try and search for the text C:\\windows\\system32 in stead
your example C:\windows\system32 actually will be found but something like c:\newcastle or c:\tivoli will not because TC treats \n as newline and \t as a tab.
So \n has to be changed to \\n and \t to \\t
your example C:\windows\system32 actually will be found but something like c:\newcastle or c:\tivoli will not because TC treats \n as newline and \t as a tab.
So \n has to be changed to \\n and \t to \\t
Last edited by petermad on 2021-12-23, 17:16 UTC, edited 1 time in total.
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: searching path in files
To find backslashes regardless of where they appear, they need to be doubled. I.e.That's also stated in TC's help:
Dalai
Code: Select all
C:\\windows\\system32
RegardsFind text
If this option is checked, you can enter text to be searched. With \t you find tabstops, and with \n line breaks (ENTER) in texts. To find a backslash \, you need to give it twice: \\ .
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: searching path in files
Surprisingly search for \n does't works that way. I can find \n always. Search for \t works as expected. Also: for find "\t" (NOT tab) it's enough to search for uppercase - "\T" with search case sensitive disabled.petermad wrote: 2021-12-23, 17:09 UTC Try and search for the text C:\\windows\\system32 in stead
your example C:\windows\system32 actually will be found but something like c:\newcastle or c:\tivoli will not because TC treats \n as newline and \t as a tab.
So \n has to be changed to \\n and \t to \\t
Re: searching path in files
I know it says so in the help, but I have no trouble finding \ as long as it is not followed by n or t - I testet all the way back to TC 6.55 and that version can also find C:\windows\system32 in a text file by entering C:\windows\system32 in the "Find text" field.Help wrote:To find a backslash \, you need to give it twice: \\ .
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: searching path in files
2Gral
Not if you have a file with only one line.I can find \n always.
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: searching path in files
2 petermad
Right.
Right.
Re: searching path in files
Anyway i think search should work different way - in three modes:
1. Normal - \t \n \ search for these explicit strings
2. Extended - \t \n search for tabs and newlines respectively
3. Regular expressions
Notepad++ text editor works exactly this way.
1. Normal - \t \n \ search for these explicit strings
2. Extended - \t \n search for tabs and newlines respectively
3. Regular expressions
Notepad++ text editor works exactly this way.
Re: searching path in files
As I wrote earlier searching for \ inside text files works fine, but if I want to search for \\ I need to enter \\\ in the "Find text" field.
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: searching path in files
This hit me today as well. I was searching for the literal string "{protools\ttFile.i}" but found nothing.
Searching for "{protools\" gave results, including files that contained "{protools\ttFile.i}"
I set these options:
- All fields empty
[x] ANSI charset (Windows)
And according to suggestions above, I tried searching both with single and double backslashes and lower and capital T:
- Find text: protools\ttFile.i
- Find text: protools\TtFile.i
- Find text: protools\\ttFile.i
- Find text: protools\\TtFile.i
But all to no avail.
It looks as if TC keeps treating \t as tab, which is confusing and counter-intuitive. I agree with @Gral that the three modes he/she describes would be much clearer.
Searching for "{protools\" gave results, including files that contained "{protools\ttFile.i}"
I set these options:
- All fields empty
[x] ANSI charset (Windows)
And according to suggestions above, I tried searching both with single and double backslashes and lower and capital T:
- Find text: protools\ttFile.i
- Find text: protools\TtFile.i
- Find text: protools\\ttFile.i
- Find text: protools\\TtFile.i
But all to no avail.
It looks as if TC keeps treating \t as tab, which is confusing and counter-intuitive. I agree with @Gral that the three modes he/she describes would be much clearer.
Re: searching path in files
2p.tingen
Try with three or four backslashes.
Regards
Dalai
Try with three or four backslashes.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: searching path in files
For to find Text {protools\ttFile.i}"
Search for: {protools\\ttFile.i}
or
Search first for: {protools\
and next for ttFile.i}
with "[x]F2 Search in found files" enabled
or
Search for: {protools.ttFile.i}
with "[x]RegEx (2)" enabled
HTH?
Search for: {protools\\ttFile.i}
or
Search first for: {protools\
and next for ttFile.i}
with "[x]F2 Search in found files" enabled
or
Search for: {protools.ttFile.i}
with "[x]RegEx (2)" enabled
HTH?
