FFIND text that includes "

Jun 20, 2011
11
0
How can I use FFIND to search files if I want to specify text that includes embedded double quotes? I want to find all lines that include "enum" including the double quotes. For example, the following isn't giving me what I want:

ffind /L /L5 /T"enum" /V *.json > c:\work\enum.txt

I've tried two, three and four double quotes on either side of enum. For example, ffind /L /L5 /T"""enum""" /V *.json > c:\work\enum.txt doesn't match anything.

However, if I use the /W dialog and enter "enum" for text, it seems to produce the correct matching lines. So, how do I do that on the command line? I need the /L5 but don't see how to do that in the dialog.

Thanks,
Sal
 
Apr 18, 2014
299
9
I'm curious about how to do the same with a regular expression (FFIND /E). Does anyone know how?

Code:
d:\temp>type foo.txt
foo
"foo"
Barney McGrew
Cuthbert
Dibble
Grub

d:\temp>ffind /kmve\"foo\" foo.txt
"foo"

d:\temp>echo "foo"^r^n | ffind /kmve\"foo\"
"foo"
 
May 20, 2008
11,437
99
Syracuse, NY, USA
Thanks, RogerB. But what if the regular expression contains a space? Then you'd need quotes for TCC also and the obvious doesn't work.

Code:
v:\> echo "1 2 3"^r^n1 2 3
"1 2 3"
1 2 3

v:\> echo "1 2 3"^r^n1 2 3 | ffind /kmve"\"1 2 3\""

v:\>
 
Jun 20, 2011
11
0
Of these examples, the use of ^q works. The use of \" produces different results, because it includes matches of \", which is common in JSON files and used to escape a double quote :). These are false matches in my use case.

Here is what works:

ffind /LL5VT"^qenum^q" js:*.json > c:\work\enum.txt

The match results are also the same as that which is produced using the dialog. Thus, conclusion is that ^q is the solution.

Where is the ^q documented?

Thanks!
 
Apr 18, 2014
299
9
Thanks, RogerB. But what if the regular expression contains a space? Then you'd need quotes for TCC also and the obvious doesn't work.

Despite what it says in the help, using quotes doesn't seem to be necessary in regular expression searches...

Code:
d:\temp>type foo.txt
foo
"foo"
Barney McGrew
"Barney McGrew"
Cuthbert
Dibble
Grub

d:\temp>ffind /kmveBarney McGrew foo.txt
Barney McGrew
"Barney McGrew"

d:\temp>ffind /kmve\"Barney McGrew\" foo.txt
"Barney McGrew"

d:\temp>echo "1 2 3"^r^n1 2 3 | ffind /kmve\"1 2 3\"
"1 2 3"

... although it wouldn't surprise me if a use case turns up where it doesn't work.
 
Apr 18, 2014
299
9
Of these examples, the use of ^q works. The use of \" produces different results, because it includes matches of \", which is common in JSON files and used to escape a double quote :). These are false matches in my use case.

Did you spot that the examples using the \" are regular expression searches (i.e ffind /e, and not ffind /t)? If you did test it with /e then apologies.

Where is the ^q documented?


If you look in the help under TCC > Command Line > Escape Character you'll find this:
Code:
Codes for Escape Characters

b backspace
c comma ,
e the ASCII ESC character (code 27)
f form feed
k back quote `
n line feed
q double quote "
r carriage return
s space
t horizontal tab character
 
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
J ffind does not find files Support 4
D ffind hangs on large file Support 18
Alpengreis ffind dialog (/W) problem Support 4
vefatica FFIND, temp files? ... not deleted? Support 0
D ffind /e hangs Support 7
vefatica FFIND needs work Support 12
Kachupp FFIND TPIPE Support 9
Gamegod ffind bug with chinese Support 2
vefatica FFIND and multi-line regular expressions Support 4
vefatica Make FFIND a bit more friendly? Support 14
M Trying to use ffind with a @file.lst doesn't work Support 4
vefatica Corruption from FFIND? Support 5
vefatica FFIND /S and System32? (and an OT mystery) Support 14
T FFind - can we display n number of lines after the find? Support 2
vefatica Help nit (FFIND and DIR with /S) Support 0
R ffind not setting %_ffind_ vars if /f is used Support 7
M FFIND wordA AND wordB Support 4
vefatica FFIND and _? Support 1
B Fixed FFIND doesn't find last character in file without CR/LF at EOF Support 1
dcantor How to make line numbers fixed width in FFIND Support 11
vefatica FFIND /S, find directory with specified name? Support 7
D Why doesn't ffind find directory? Support 3
C FFind /w works but FFind /= doesn't? Support 2
vefatica FFIND goes crazy Support 8
Stefano Piccardi TCC 13 vs. TCC 14 different FFIND /E"d$" output Support 1
Steve Pitts How to? FFIND, regular expressions and double quotes Support 4
vefatica FFIND /S in my profile directory Support 2
A How to? Pass output from ffind to another command in a BTM file Support 5
Phileosophos Can FFIND match file names with a regular expression? Support 19
vefatica FFIND and size ranges Support 1
R How to use ffind to find older files? Support 9
J How do I - ffind - with multiple items Support 10
M FFIND and LIST does not work for UTF-8 fles Support 10
C FFIND ERRORLEVEL Support 2
L FFIND no result display Support 10
H Directory wildcards not working with ffind Support 3
D ffind and directories Support 2
Stefano Piccardi detecting BOM, FFIND multibyte regex Support 18
dcantor FFIND syntax -- is /E"regex" /X supported? Support 2
S FFIND and quoted strings Support 4
S FFIND /E"reg exp" : not case insensitive Support 4
J Problem with FFIND Support 1
vefatica Tab (^t) in @FILEWRITE's text Support 2
R Bug TPIPE's pdf to text conversions don't work Support 2
Joe Caverly Using TYPE with non-English text Support 22
M Goto fails when a text endtext block precedes the code Support 5
Joe Caverly No blank line in TEXT...ENDTEXT in a LIBRARY function Support 8
S INPUT fails if the entered text contains pair of square brackets Support 6
Alpengreis List command: text truncated in find box (german) Support 9

Similar threads