Using 'FIND' in Notepad

E

Eric

Hey out there.
Just wondering if there is any way to use the Find function in
Notepad, with a variable.
For example:
looking for string "error" but wanting to exclude "error=null"
I am reviewing a .txt file and have to search for the word 'error'.
However, sometimes the file contains "error=null" several hundred
times. I would like to be able to have the find search for "error"
except "error=null".
Can this be done with notepad?
Thanx in advance.
 
J

Jerold Schulman

Hey out there.
Just wondering if there is any way to use the Find function in
Notepad, with a variable.
For example:
looking for string "error" but wanting to exclude "error=null"
I am reviewing a .txt file and have to search for the word 'error'.
However, sometimes the file contains "error=null" several hundred
times. I would like to be able to have the find search for "error"
except "error=null".
Can this be done with notepad?
Thanx in advance.

No, but, run the following batch:

@echo off
REM The next 2 lines are 1 line
for /f "Tokens=*" %%a in ('type filename.txt^|findstr /i /v
/c:"error=null"^|findstr /i /c:"error"') do (
@echo %%a>>newfile.txt


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top