I have a folder containing several .docx files with names [Code2001.docx, Code2002.docx... Code2154.docx]
.
I'm trying to write a script that will:
- Open each .docx file
- Append one line to the document; "This is checked"
- Save the .docx-file to another folder, named "Code2001_checked"
After searching I've only managed to get the filename with the loop:
import os
os.chdir(r"E:......est")
for files in os.listdir("."):
if files.endswith(".docx"):
print filename
I also found this: docx module but the documentation is poor to continue.
Any suggestions on how to finish this script?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…