I am reading a docx file and displaying the data of it.
Lets say I have two files abc.docx and xyz.docx, where abc has some table along with some paragraphs. I want to display the data as it is in docx. But my below code is extracting texts and printing it.Can someone suggest me how can I do this?
Below is my code:
import docxpy
file1 = 'abc.docx'
file2 = 'xyz.docx'
message1 = docxpy.process(file1)
message1 = message1.encode('ascii', 'ignore').decode('ascii')
message2 = docxpy.process(file2)
message2 = message1.encode('ascii', 'ignore').decode('ascii')
message = message1 + message2
print(message)
I need to display the data as it is in docx file. Here the text inside my table is displaying but not the table. What can be done here?