locked
The reverse of the "findstr" command in a batch file. RRS feed

  • Question

  • Hi.

    I hope I'm in the right place.  I am trying to run a command/batch file on a really large text file to replace all lines of text with the exception of certain lines which contain a certain word.  I know this can be done to 'delete' certain lines and keep the others using the "findstr" command.  What this command does is deletes all lines in a text file that contain specific words whilst keeping all other lines.

    I want to do the exact opposite to this.  I want to keep certain lines of text containing specific words whilst deleting all others.

    Does anyone know what this command might be?  Or is there a switch one can use with "findstr" command to do it?

    All help appreciate

    J


    Wednesday, April 30, 2014 8:49 AM