Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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
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

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

share|improve this answer

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

share|improve this answer

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

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
for i in *.pdf; do pdftotext $i - | grep -im1 search_string && echo $i"\n"; done
share|improve this answer

Agent Ransack has always done the trick for me.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .