我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

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

How can I parse word documents ".doc", ".docx" to get all the text using golang?

You can get some inspiration from those projects:

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

Basically, DOCX is a Zip file with XMLs in it. All the texts are inside document.xml

What both project do is remove all XML tags, leaving only text intact. You should see if that approach suits you too.

用 unioffice这个库。不过不太懂怎么用……

近期文章

  • 检查struct是否为空,如果struct包含json.RawMessage
  • Golang:如何实现传递方法/功能
  • 在golang中,服务器端无法进行PDF下载
  • 如何设置仅适用于我的局域网的golang服务器监听器
  • 自动生成的代码中的全限定导入路径
  • 减少Golang中的代码重复
  • 如何从pongo模板调用Go函数
  • Golang定期检查端口上打开的TCP连接
  • 将结构复制到实现接口的结构中
  • 去模板绑定常量数组值
  • Golang JSON解码无法解码接口{}
  • Golang API编码问题
  • AppEngine数据存储区:字节分片vs数据存储区。
  • 比较两个切片并删除Golang中的唯一值
  • Go程序陷入僵局
  • Golang在尝试使方法并发时没有任何回报
  • 用于密码检查的PHP正则表达式模式在Go中不起作用
  • 编写可以操纵几种相似类型的函数
  • 如何进行反射,新建切片并进行反射,将切片附加到源切片
  • 用于存储具有重复键的键值对的数据结构

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华