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
llllllllllllllii
V2EX  ›  Python

4202 年了,有没有好的 doc 文件内容处理方案啊

  •  
  •   llllllllllllllii · 11 天前 · 1417 次点击

    python-docx 可以处理 docx 文件,doc 会有问题。 如果将 doc 转为 docx 就需要借助外部 win32com 或 libreoffice ,有没有能不借助外部处理方法 或者有没有可以处理 doc 内容获取的的库

    12 条回复    2024-06-08 17:41:46 +08:00
    openmynet
        1
    openmynet  
       11 天前
    Linux 系统下可以使用 wv 进行处理

    wvHtml input.doc output.html
    # to text
    wvText input.doc output.txt

    alpine3 liunx:
    apk add --no-cache wv

    ubuntu:
    apt-get install -y wv
    azarasi
        2
    azarasi  
       11 天前
    pandoc
    undeflife
        3
    undeflife  
       11 天前   ❤️ 6
    4202 年了,我的方案是不兼容 doc 和 xls 格式
    Latin
        4
    Latin  
       11 天前
    antiword
    djangovcps
        5
    djangovcps  
       11 天前
    aspose
    xiqnshang
        6
    xiqnshang  
       11 天前
    我之前处理 doc 文件,写了个转换服务把 doc 转成 docx ,然后把 docx 丢给后台处理
    ysc3839
        7
    ysc3839  
       11 天前 via Android
    看看 WPS 有没有提供什么 API ?
    lisxour
        8
    lisxour  
       11 天前   ❤️ 1
    还是算了吧,毕竟不开源的格式,你强行支持,在用的时候遇到兼容问题这才真的头痛,你自己几乎是完全无法解决的。
    bugmakerxs
        9
    bugmakerxs  
       11 天前
    word 处理还是第三方比较靠谱,wps ,libreoffice ,aspose
    wumoumou
        10
    wumoumou  
       10 天前
    mammoth.browser.js 这个可以把 doc 转成 html ,提取 html 的内容相对容易些
    TsubasaHanekaw
        11
    TsubasaHanekaw  
       10 天前
    找台 windows 用 com+接口把 doc 转成 docx,同时还能完成 word ,excel ,ppt 转成 pdf 这些麻烦操作
    fuge
        12
    fuge  
       10 天前
    Powershell
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3010 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 13:49 · PVG 21:49 · LAX 06:49 · JFK 09:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.