Delete line from text file using batch command
Posted on 2009-07-02
I have a batch file that creates a text doc from an AD query. Basically it produces a text file with a list of all hosts from particular OU's on the domain. The idea is that I can then use this list to run various scripts and commands against.
I wish to add a line in my batch file AFTER the creation of this doc that will allow me to remove given lines with me providing hostnames in the string. This is to exclude certain systems from whatever commands I run post this.
So, basically, does anyone know a DOS string that will search a text file for a text string and then delete any lines with that contain that string and save the modded text file?
Hope this makes sense!