How you can implement deleting lines in a text document up to a certain line? I find the line number using the code:
#!/usr/bin/env python
lookup = '00:00:00'
filename = "test.txt"
with open(filename) as text_file:
for num, line in enumerate(text_file, 1):
if lookup in line:
print(num)
print(num)
outputs me the value of the string, for example 66.
How do I delete all the lines up to 66, i.e. up to the found line by word?