I need to copy a certain line from a text document, this I have done by using a "key-word" in the document. My problem now is that I also want to copy the entire line below this specific line. Help is much appreciated as I am new with programming
FILE = open('test.txt', 'r')
FILE2 = open('test2.txt', 'w')
for line in FILE.readlines():
if "key-word" in line:
FILE2.write(line)
FILE1.close()
FILE2.close()