python-docx2txt
python-docx2txt copied to clipboard
The result contains extra newline
Left is original doc file, right is file I exported with following code
import docx2txt
import os
def write_file(name, content):
with open(name, 'w') as file:
file.write(content)
files = os.listdir()
for file in files:
if file.endswith('.docx'):
text = docx2txt.process(file)
write_file(file.replace('.docx', '.srt'), text)