I have a text file which I obtained from converting a .srt file. The content is as follows:
1 0:0:1,65 --> 0:0:7,85 Hello, my name is Gareth, and in this video, I'm going to talk about list comprehensions 2 0:0:7,85 --> 0:0:9,749 in Python.
I want only the words present the text file such that the output is a new textfile op.txt, with the output represented as:
Hello my name is Gareth and
and so on.
This is the program I'm working on:
import os, re
f= open("D:\captionsfile.txt",'r')
k=f.read()
g=str(k)
f.close()
w=re.search('[a-z][A-Z]\s',g)
fil=open('D:\op.txt','w+')
fil.append(w)
fil.close()
But the output I get for this program is:
None None None