Search code examples
pythonlinuxoleextract

How to extract office embedded OLE files under Linux, Nativly (Python,C,Java)?


I am trying to extract Excel Documents which embedded inside word document as OLE but its failing hard.

I need to put it in server side script so console or script is necessary. And automating Open Office is very resource hungry ..

Is there any tool or libraries to do this ? Please help..


Solution

  • I built a python module to do exactly this check it out over here. https://pypi.org/project/AttachmentsExtractor/ also the module can be run on Linux os.

    after installing the library use the following code snippet:

     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.