如何在Linux下提取Office嵌入的OLE文件(Python、C、Java)?
我正在尝试从Word文档中提取嵌入的Excel文件,这个过程却遇到了很大的困难。
我需要把这个功能放在服务器端,所以需要用到控制台或者脚本。而且自动化处理Open Office会消耗很多资源……
有没有什么工具或者库可以做到这一点?请帮帮我……
1 个回答
4
我做了一个Python模块,可以专门用来做这个检查,大家可以在这里看看。https://pypi.org/project/AttachmentsExtractor/ 这个模块也可以在Linux操作系统上运行。
安装好这个库之后,可以使用下面的代码片段:
from AttachmentsExtractor import extractor
abs_path_to_file='Please provide absolute path here '
path_to_destination_directory = 'Please provide path of the directory where the extracted attachments should be stored'
extractor.extract(abs_path_to_file,path_to_destination_directory) # returns true if one or more attachments are found else returns false.