21 lines
521 B
Python
21 lines
521 B
Python
'''
|
|
Created on 30 mar 2020
|
|
|
|
@author: Emanuele Trabattoni
|
|
'''
|
|
import glob, docx2txt
|
|
|
|
if __name__ == '__main__':
|
|
fList = glob.iglob("../TestFiles/File nuovo formato/*.docx")
|
|
for f in fList:
|
|
#os.remove(f.replace('.docx', '.txt'))
|
|
print(f)
|
|
try:
|
|
txt=docx2txt.process(f)
|
|
with open(f.replace('.docx', '.txt'), 'wb') as fp:
|
|
fp.write(txt.encode('ansi'))
|
|
fp.close()
|
|
except Exception as e:
|
|
print(e)
|
|
pass
|
|
pass |