对的,这是可能的.LibreOffice(至少)有一个命令行选项来转换可以处理的文件.使用它将文件转换为文本.然后按照例行操作将文本文件加载到Python中.
这在LibreOffice 4.2/Linux上对我有用:
soffice --headless --convert-to txt:Text /path_to/document_to_convert.doc
Run Code Online (Sandbox Code Playgroud)
我尝试了一些方法(包括odt2txt,antiword,zipfile,lpod,uno).上面的soffice命令是第一个简单而无错误的命令.关于在ask.libreoffice.org上使用过滤器的这个问题帮助了我.soffice
归档时间: |
|
查看次数: |
15082 次 |
最近记录: |