r/pythonhelp • u/damof3 • May 23 '22
HOMEWORK Split Lines between Two Points
I have a file that has some random words at the start and end on different amounts of lines each time. I am trying to only read the lines between the first point *** START OF SYNTHETIC TEST CASE *** and the second point *** END OF SYNTHETIC TEST CASE ***. How would I go about writing this
0
Upvotes
1
u/CraigAT May 23 '22
Open the file, read in a line at a time, check the line contents, once you match with the start sequence append any lines to your list of useful lines, when you detect the end sequence stop.