in reply to Re^2: Search and replace next line
in thread Search and replace next line

Your script will only work if the wanted line is in the line immediately following the searched one.

True. But I understood him as wanting to replace the immediately following line.

Your script will print both the original and replaced lines.

Really? What does it output for you? For me, it says

test data more TheLineBefore LocalCompilerPresent=0 more stuff
which I take to be correct. No?