Lets say I have a Text file with the below content
fdsjhgjhg fdshkjhk Start Good Morning Hello World End dashjkhjk dsfjkhk
Now I need to wr
I would handle it like this :
inFile = open("data.txt") outFile = open("result.txt", "w") data = inFile.readlines() outFile.write("".join(data[data.index('Start\n')+1:data.index('End\n')])) inFile.close() outFile.close()