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.

Is there a free way to perform a text search in PDF and XLS (Excel spreadsheet) files?

I want to be able to find a specific word in these type of files.
Is there a free tool for that?

share|improve this question

migrated from stackoverflow.com Jan 18 '10 at 12:41

This question came from our site for professional and enthusiast programmers.

    
Hello, welcome to Superuser. Your question has been migrated here, as it is more suited. I recommend you to create an account here, and associate it with your StackOverflow account, in your user options, so you can take back the ownership of this question. –  Gnoupi Jan 18 '10 at 16:44
add comment

7 Answers

up vote 3 down vote accepted

There are several open source tools that convert binary files like PDF or XLS to plain text. Then use grep to search the text.

For instance:

$ pdftotext file.pdf | grep "some text"

Some tools:

If you are on Windows, I suggest you install Cygwin and add the xpdf and catdoc packages. On my Ubuntu GNU/Linux box, I type apt-get install xpdf-utils catdoc to install the tools I mention above.

share|improve this answer
add comment

The free viewer xpdf, native to Unix/X, can perform text searching including OCR on scanned pages and images. I was startled when I found that out as it is such an ancient tool.

It is also available for Windows. See http://gnuwin32.sourceforge.net/packages/xpdf.htm

share|improve this answer
add comment

Total Commander has a plugin called TextSearch that can search through almost anything you can throw at it.

share|improve this answer
add comment

Do you want to find files that contain your search terms or every instance of the search terms in each file?

If you're running Windows XP (or later, I assume), you can simply use Windows search to do the former. Go to the directory where your files are and hit Ctrl-F. Put what you're searching for in the Containing Text box, and away you go. Excel and PDF files that contain your search terms will be included in the results.

To search within each file, just open it and hit Ctrl-F. Both Excel and all PDF readers include text searching within the document you're looking at.

share|improve this answer
add comment

For searching XLS files and PDF files with text available, you can search with local search engines like:

Note that you will not be able to search scanned PDFs as the text is not embedded in the PDF. However it is possible to use Optical Character Recognition (OCR) software to embed text into PDFs.

share|improve this answer
add comment
for i in *.pdf; do pdftotext $i - | grep -im1 search_string && echo $i"\n"; done
share|improve this answer
add comment

Agent Ransack has always done the trick for me.

share|improve this answer
add comment

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.