I would like to copy certain lines of text from one text file to another. In my current script when I search for a string it copies everything afterwards, how can I copy jus
If all of that did not work try this.
with open("hello.txt") as f: with open("copy.txt", "w") as f1: for line in f: f1.write(line)