Aug-28-2022, 03:32 AM
(This post was last modified: Aug-28-2022, 10:15 PM by Pedroski55.)
I made a simple function to get text from .docx files. Works OK.
Now I have a file containing a text frame at the top, a little text and a big table.
I can't get the text from the table or the text frame. Any tips on how that might be achieved?
table_Adverbs_ly.docx (Size: 7.32 KB / Downloads: 360)
Now I have a file containing a text frame at the top, a little text and a big table.
I can't get the text from the table or the text frame. Any tips on how that might be achieved?
import docx
def getText(filename):
print(len(doc.paragraphs))
doc = docx.Document(filename)
fullText = []
for para in doc.paragraphs:
fullText.append(para.text)
return '\n'.join(fullText)
myfile = input('Enter the full path to the file you want ... ')
text = getText(myfile)This only gets free-standing text, not text in the frame or the table.
table_Adverbs_ly.docx (Size: 7.32 KB / Downloads: 360)
