Objective: I need to extract text from table (with Column Names as Name, address, contact number, email, etc) from .ppt files. For this I followed this approach:
I converted .ppt file to pdf and then extracted the data from pdf using PDFminer. The text extracted from pdf is not separated by any delimiter. Due to this it is very difficult to distinguish names and other fields in the table.
Probable solution I am working on:
I am stuck at first step of converting the file format from .ppt to .pptx. I couldn't find any solution for converting .ppt file format to .pptx formt in python.
I have created this code hope this works for you :
import win32com.client
PptApp = win32com.client.Dispatch("Powerpoint.Application")
PptApp.Visible = True
PPtPresentation = PptApp.Presentations.Open(r'D:\ppt\sample.ppt')
PPtPresentation.SaveAs(r'D:\ppt\final.pptx', 24)
PPtPresentation.close()
PptApp.Quit()
For MacOS Homebrew users: install Apache Tika (brew install tika
)
The command-line interface works like this:
tika --text something.ppt > something.txt
And to use it inside python script:
import os
os.system("tika --text temp.ppt > temp.txt")
You will be able to do it and that is the only solution I have so far.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With