in reply to Re: How do I delete lines matching a certain condition and make sure each line has the right prefix and suffix?
in thread How do I delete lines matching a certain condition and make sure each line has the right prefix and suffix?
I also prefer the line by line approach, especially because I am mostly dealing with files having tens or even hundreds of millions lines, and writing to another file is also a must for me, because I may need to undo things if something went wrong. As a side note, there is no need to escape the pipe ("|") character in the replacement values of the s/// operator.