簡體   English   中英

有什么方法可以使用 python 找到 word docx 文件的結尾

[英]Is there any method to find the end of word docx file using python

我被困在一個 position,我需要使用 python 找到一個 word 文檔的結尾。我嘗試了很多組合,比如 XML 解析器來找到一個特定的標簽(W:類型)但沒有用。 所以大家請幫助解決您的解決方案或解決此問題的任何想法。

樣品格式

doc文件結構如下

1.docx

[標題]

身體.. 。 . . . .

[身體結束]

[頁面結束] // 我需要使用 python 找到這個點


使用python-docx

from docx import Document

document = Document('<your_docx_path>')

for paragraph in document.paragraphs:
    if '<text_you_want_to_find>' in paragraph.text:
        // find point

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM