“C”语言的 Microsoft Word 文本解析器

发布于 2024-07-08 10:39:59 字数 166 浏览 2 评论 0原文

我想知道从 Microsoft Word(.doc 和 .docx)文档中解析和获取文本内容的过程。 使用的编程语言应该是纯“C”(应该是 gcc)。

是否有任何库已经完成这项工作,

扩展:我可以使用相同的过程来解析 Microsoft power point 文件中的文本吗?

I would like to know the procedure to adopt to parse and obtain text content from Microsoft word (.doc and .docx) documents . programming language used should be plain "C" (should be gcc).

Are there any libraries that already do this job,

extension : can i use the same procedure to parse text from Microsoft power point files also ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

静待花开 2024-07-15 10:39:59

Microsoft Word 文档是一个巨大的野兽 - 您绝对不想自己编写这些代码。 考虑使用现有的免费 Word 库,例如 antiwordwvWare

Microsoft Word documents are an enormous beast - you definitely don't want to be writing this code yourself. Look into using an existing free Word library such as antiword or wvWare.

若相惜即相离 2024-07-15 10:39:59

我不知道是否存在库,但格式规范可从 Microsoft 免费并承诺不会因使用它们而起诉您。

I don't know about libraries that exist, but the format specifications are available from Microsoft for free and under a promise not to sue you for using them.

依 靠 2024-07-15 10:39:59

在 Windows 上,让 word 完成这项工作并与 COM 对象交互,在 Linux 上,这项工作是在 antiword< 中完成的/a>. 或者,您可以使用 OpenOffice.org 在任何平台上实现自动化。 services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Professional_UNO" rel="nofollow noreferrer">UNO 对象模型。

on windows, let word do the job and interface with the COM object, on linux, the job was done in antiword. Or you can automate OpenOffice.org on any platform with the UNO object model.

谈场末日恋爱 2024-07-15 10:39:59

如果您愿意尝试在 C 语言中使用 COM 接口,则可以使用 IFilter 接口内置于 Windows 2000 以来的每个版本的 Windows 中。您可以使用它从任何 Office 文档(Word、Excel 等)中提取文本、PDF 文件或安装了 IFilter 支持的任何文件类型。

我写了一个 博客几年前发布了关于它的文章。 全部都是 C++,但您可以使用 C 中的 COM 对象。

If you're willing to go through the effort of using a COM interface in C, you can use the IFilter interface built into every version of Windows since Windows 2000. You can use it to extract text from any office document (Word, Excel, etc.), PDF file or any file type that has IFilter support installed.

I wrote a blog post about it a few years back. It's all C++, but you can use COM objects from C.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文