Skip to content
Advertisement

Tag: docx

How do I extract tables from word via table titles?

I’m facing the problem of trying to extract data from word files in the form of tables. I have to iterate through 500 word files and extract a specific table in each file, but the table appears at a different point in each word file. This is the code I have: Which goes through all the files fine, but gets

Python-docx: Find and replace all placeholder numbers in Word doc with random numbers

I’m having trouble finding and replacing all occurrences of several placeholders within paragraphs of a Word file. It’s for a gamebook, so I’m trying to sub random entry numbers for the placeholders used while drafting the book. All placeholders begin with “#” (e.g. #1-5, #22-1, etc.). Set numbers, like the first entry (which will always be “1”), don’t have the

is it possible to write image to csv file?

Hi everyone this is my first post here and wanted to know how can ı write image files that ı scraped from a website to a csv file or if its not possible to write on csv how can ı write this header,description,time info and image to a maybe word file Here is the code Everything works perfectly just wanna

How do I change Heading font face and size in python-docx?

I filed this as a python-docx issue: https://github.com/python-openxml/python-docx/issues/805 but was requested to open a discussion here. https://python-docx.readthedocs.io/en/latest/user/styles-using.html implies that I should be able to change Heading font styles like this: But that doesn’t work: the resulting document uses Calibri for all headings. (They’re also blue and Heading 1 has an underline, which I also need to eliminate somehow.) It also

Python populate a docx table with DocxTemplate

I read this documentation on python-docx-template but I’m pretty confused on the table section. Let’s say I have a docx template called Template.docx. Inside the docx file i have a table that only has headers for it’s title. How can I use python-docx-template to dynamically populate the table (add rows and values)? Answer In general, you unlease the power of

Advertisement