python-docx2txt icon indicating copy to clipboard operation
python-docx2txt copied to clipboard

The result contains extra newline

Open DanteAndroid opened this issue 2 years ago • 0 comments

image 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)

DanteAndroid avatar Jun 10 '22 04:06 DanteAndroid