# Batch File To Remove Certain Lines



## btthevoice (Nov 5, 2008)

Can someone post Batch File code that will run thru a text file and remove any lines that contains the string "Compressed File" or any line that contatins the string "Error On File" and then rewrite that text file without them?


----------



## -Fabez- (Jul 28, 2008)

Use a higher level language like Python, it will be much easier. Also try to do some of it yourself and ask if you cannot do parts of it, instead of expecting someone else to do it for you.


----------



## btthevoice (Nov 5, 2008)

Thanks for your response..however..learning another language is not an option given my time frame. I am under a very tight time constraint to get this accomplished and playing around with code and dabbling is not something I can consider. If someone would like to help me out with some code here in this situation, I would appreciate it.


----------



## btthevoice (Nov 5, 2008)

just got the answer from another forum..here it is FYI.
@echo off
find /v "Compressed File" < myfile | find /v "Error On File" > newfile
copy newfile myfile & del newfile


----------

