0

I have a simple batch file, which reads a txt file containing simple lines and looks for a specific word in it, for example "Error". If the word is in the txt file, it opens a CMD with the message "FOUND". So far so good.

Now...is there a way to show the whole line in the CMD containing the searched word, for example:

"1. There is an Error in building A."

Thanks...

Ajdin
  • 57
  • 3

1 Answers1

0

Use the findstr command, like this:

findstr /l /s Error file.txt
Vad Sim
  • 266
  • 8
  • 21
  • Your answer does not directly answer the question asked. Also it appears to be utilising a strange choice of options. – Compo Jun 01 '22 at 13:34