<h2 id="tools-to-extract-data-from-docx-files">Tools to extract data from docx files:</h2>
<ol>
<li><a href="https://manpages.ubuntu.com/manpages/focal/man1/docx2txt.1.html">docx2txt</a></li>
<li><a href="https://github.com/ankushshah89/python-docx2txt">python-docx2txt</a></li>
<li><a href="https://python-docx.readthedocs.io/en/latest/">python-docx</a></li>
</ol>
<h2 id="code-snippets">Code Snippets</h2>
<pre><code>text = docx2txt.process(src, img_dest)
with open(&quot;data.txt&quot;, &quot;wt&quot;) as f:
    f.write(text)
</code></pre>
<pre><code>document = docx.Document(src)
tables = document.tables
data = []
for table in tables:
    table_data = []
    for row in table.rows:
        row_data = []
        for cell in row.cells:
            row_data.append(cell.text)
        table_data.append(row_data)
    data.append(table_table)

for i, table in enumerate(tables):
    with open(f&quot;{i}.csv&quot;, &quot;wt&quot;) as f:
        writer = csv.writer(f)
        writer.writerows(table)
</code></pre>
