如何在 Word 2007 .docx 文件中搜索单词? [英] How can I search a word in a Word 2007 .docx file?

查看:30
本文介绍了如何在 Word 2007 .docx 文件中搜索单词?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Word 2007 文件 (.docx) 中搜索文本字符串,例如可以/将在 Word 中搜索的某些特殊短语".

I'd like to search a Word 2007 file (.docx) for a text string, e.g., "some special phrase" that could/would be found from a search within Word.

有没有办法从 Python 中查看文本?我对格式没有兴趣 - 我只想将文档分类为是否有一些特殊短语".

Is there a way from Python to see the text? I have no interest in formatting - I just want to classify documents as having or not having "some special phrase".

推荐答案

更准确地说,.docx 文档是 OpenXML 格式的 Zip 存档:您必须先解压缩它.
我下载了一个示例(谷歌:some search term filetype:docx),解压后找到了一些文件夹.word 文件夹包含文档本身,位于文件 document.xml 中.

More exactly, a .docx document is a Zip archive in OpenXML format: you have first to uncompress it.
I downloaded a sample (Google: some search term filetype:docx) and after unzipping I found some folders. The word folder contains the document itself, in file document.xml.

这篇关于如何在 Word 2007 .docx 文件中搜索单词?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆