V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
alfer
V2EX  ›  Python

python 解析 word 的 doc 格式,有什么好办法?

  •  
  •   alfer · 2016-10-21 14:35:48 +08:00 · 5245 次点击
    这是一个创建于 2716 天前的主题,其中的信息可能已经有所发展或是发生改变。

    方案一: python 解析 docx 格式支持良好但对 doc 格式支持很差,故希望 doc 转为 docx 格式,有什么好办法? 方案二:将 doc 转为 html 格式,然后解析 html ,测试后发现如果数据量大了支持也不好 大家有什么好办法吗?

    注:有近 1w 个*.doc 文档,每个文档 100Mz 左右

    6 条回复    2016-11-01 09:26:10 +08:00
    vicalloy
        1
    vicalloy  
       2016-10-21 14:44:24 +08:00
    是需要提取 doc 里的内容?
    https://github.com/dagwieers/unoconv 用这个可以将 doc 转成 html 或 docx 。
    alfer
        2
    alfer  
    OP
       2016-10-21 15:51:58 +08:00
    @vicalloy 提取 word 中的表格
    contractswif
        3
    contractswif  
       2016-10-21 22:39:22 +08:00
    py 通过 office 之类的软件打开 doc ,转换成 docx ,然后自由发挥。这样呢?
    contractswif
        4
    contractswif  
       2016-10-21 22:40:00 +08:00
    之前转换了 2000 多个 doc 入 pdf 用的这种方式
    xuboying
        5
    xuboying  
       2016-10-22 14:59:26 +08:00 via iPhone
    这种特殊需求还不如现学 VBA 三下五除二,别信 Python 的唯有唯一正确解的梦话。 Perler 说过黑猫白猫,都是好猫
    zungmou
        6
    zungmou  
       2016-11-01 09:26:10 +08:00 via iPhone
    用 c#调用 office 接口操作 word 进行解析,应该很容易。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2864 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:39 · PVG 19:39 · LAX 04:39 · JFK 07:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.