Python Forum
Use module docx to get text from a file with a table
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use module docx to get text from a file with a table
#7
Thanks for the info!

I always use Libre Office, except when I need to interact with Python, then I save things in Excel or Word format.

It is noticeable that Excel or Word documents are smaller than their Libre Office counterparts.

Once, I made a typo while saving and saved a document like this: test.docx_

Do that, then look at the file, you have a zip file. Open that.

The document.xml contains the text, just need a parser to get the text from the <w:t>

<w:t>Hello me.</w:t>

Any other stuff must be in there, just a matter of parsing the right xml tags.

Python probably has an xml parser!
Reply


Messages In This Thread
RE: Use module docx to get text from a file with a table - by Pedroski55 - Aug-30-2022, 12:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 1,138 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Replace a text/word in docx file using Python Devan 4 4,013 Oct-17-2023, 06:03 PM
Last Post: Devan
  Color a table cell based on specific text Creepy 11 2,254 Jul-27-2023, 02:48 PM
Last Post: deanhystad
  Tkinterweb (Browser Module) Appending/Adding Additional HTML to a HTML Table Row AaronCatolico1 0 1,011 Dec-25-2022, 06:28 PM
Last Post: AaronCatolico1
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,204 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  python-docx regex: replace any word in docx text Tmagpy 4 2,357 Jun-18-2022, 09:12 AM
Last Post: Tmagpy
  Modify values in XML file by data from text file (without parsing) Paqqno 2 1,800 Apr-13-2022, 06:02 AM
Last Post: Paqqno
  How to perform DESC table sort on dates stored as TEXT type. hammer 7 2,336 Mar-15-2022, 01:10 PM
Last Post: hammer
  Converted Pipe Delimited text file to CSV file atomxkai 4 7,193 Feb-11-2022, 12:38 AM
Last Post: atomxkai
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 7,982 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020