Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Any there any linux tools that will extract the text from a Powerpoint pptx file? I tried catppt but it just returns file.pptx is not OLE file or Error. abiword --to=txt file.pptx also returns an empty text file.

I can open the file in libreoffice but it doesn't seem to have an "export as text" option. As a guess I also tried libreoffice --headless --convert-to txt:Text file.pptx but that doesn't even return an empty file.

share|improve this question
    
Tried textedit with this as well, and it had nothing in it. Claims the file is locked too. Wonder if its some sort of proprietary thing microsoft implemented –  Simon Sheehan Oct 17 '13 at 16:59

4 Answers 4

up vote 3 down vote accepted

If you can process the files in bash, this one-liner will unpack all the text:

unzip -qc "$1" ppt/slides/slide*.xml | grep -oP '(?<=\<a:t\>).*?(?=\</a:t\>)'

Just pass it the pptx file as $1, and it will write the text into file $2. The content of each slide will not appear in presentation order, and there will be no labels or anything, so you'll need a few more lines of script and a temp directory to get a more readable listing.

share|improve this answer
    
I've been searching for binaries and perl scripts for a while now and this answer is so simple and effective. I'm just looking to get a basic text-dump from slides, nothing fancy, and this does it perfectly. I wish I could give it more +1's! –  Chris Haas May 7 at 16:02

If you add .zip at the end of the filename (i.e Presentation1.pptx.zip) you can then unzip the document and view it's indvidual components.

In this resulting zip file there is the following directory \Presentation1.pptx.zip\ppt\slides. This contaions .xml files named after each individual slide. If you open one of these files you will see that any entered text is wrapped in <a:t> tags.

For example: <a:t>TEST</a:t>

This is as far as I can help you, but hopefully it's enough.

EDIT: As a side-note, the same process works for Word Documents as well. It's quite useful if you ever need to extract images from a Word Document.

share|improve this answer

You may try saving the ppt file in pdf format, then use pdftotext on it to retrieve existing text. Of course, all text embedded in figures is lost forever.

Alternatively, you may try the command

 string filename

on either the ppt or the pdf.

share|improve this answer

Since you have Abiword installed you can just make a PDF first

libreoffice --headless --convert-to pdf filename.pptx

And then use abiword to convert the pdf to txt

abiword --to=txt filename.pdf 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.