Hi; I'm learning Python, need a little help here.
I have a text file which has the below data,
<SYNC Start=5047><P Class=ENCC>
Back, back, back, back!
<SYNC Start=7235><P Class=ENCC>
<SYNC Start=10725><P Class=ENCC>
Yeah, Dan!
I want to strip the text only i.e.
Back, back, back, back!
Yeah, Dan!
I'm using this code, but it gives the lines that I want to ignore
new_list = []
ignore=False
for line in file("tstl.txt"):
data_list = line.split(" ")
if line.startswith("<"):
if line.endswith(">") or line.endswith(";"):
ignore=True
if ignore:
new_list.append(line)
fout = open("tst2.txt", "w")
fout.writelines(new_list)
fout.close()
Could somebody guide me in this regard?