解析 .doc 和 .docx 以使用 golang 获取所有文本?

Parse .doc & .docx for get all text using golang?

如何使用golang解析word文档“.doc”、“.docx”获取所有文本?

你可以从这些项目中得到一些启发:

https://github.com/nguyenthenguyen/docx
https://github.com/opencontrol/doc-template

基本上,DOCX 是一个包含 XML 的 Zip 文件。 所有文字都在document.xml

里面

这两个项目所做的是删除所有 XML 标签,只保留完整的文本。你应该看看这种方法是否也适合你。