FFIND ERRORLEVEL

Feb 11, 2011
10
0
TCC 11.00.52

I'm using FFIND to search text files for a string. I need to know if the string was found in any of the files - it doesn't matter which specific file contained the string.

I expected that FFIND would set ERRORLEVEL (or _?) to indicate the presence or abserce of a match, but it doesn't seem to do so.

Am I missing something? Is there another command which I can use to accomplish this?
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
I'm using FFIND to search text files for a string. I need to know if the string was found in any of the files - it doesn't matter which specific file contained the string.

FFIND only sets the errorlevel if there was an error -- and not finding a match is not considered an error.

If you just want to check the results to see if anything matched, you can use the FFIND /U option. If you want to test it in a batch file, you can use @EXECSTR to return the FFIND result and parse that.
 
Feb 11, 2011
10
0
FFIND only sets the errorlevel if there was an error -- and not finding a match is not considered an error.

If you just want to check the results to see if anything matched, you can use the FFIND /U option. If you want to test it in a batch file, you can use @EXECSTR to return the FFIND result and parse that.

Thanks for the quick answer.
 
Similar threads
Thread starter Title Forum Replies Date
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
S FFIND text that includes " Support 7
D ffind /e hangs Support 7
vefatica FFIND needs work Support 12
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
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
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
Joe Caverly PSHELL and @PSHELL errorlevel values Support 4
D COPY returns ERRORLEVEL 2 Support 5
D on errorlevel causes btm to mess up TCC Support 7
D on errorlevel n only executes when equal Support 1
M ON ERRORLEVEL not being trapped Support 1

Similar threads