i'm trying to find a word in a CMD command output (like using ctrl+f in a file) the output contains a lot of lines ...
Any hints ? thanks .
find "yourword" filename
to show your word in any line of a file.
yourcommandgivingsoneoutput | find "yourword"
to examine the output of some command for your word.
If you just want to see whether your word ixists in the data, then append >nul to the line to suppress output and on the next line of (presumably) your batch use
if errorlevel 1 (echo word missing) else (echo word found)
There are many options which you can invoke - use
find /?
from the prompt for documentation.
findstr is similar, and allows searching for multiple words and has a restricted regex implementation.
findstr /?
from the prompt for documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With