Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I want to search a snipet, like searchPart1 some unknown text searchPart2 in a text file, I use searchPart1.*searchPart2. But this is not possible in any pdf reader I use. Currently I convert pdf to a text file and open it using less or geany, then use regular expression available on it.

Is there a Pdf reader with regular expression search other than the commandline pdfgrep

share|improve this question
    
pdfgrep is a grepper so it didn't answer the question completely. A pdf reader with inbuilt pdfgrep is required to accept the answer –  totti Feb 28 '13 at 6:32

1 Answer 1

pdfgrep, in the repos, isn't exactly a reader and requires use of the terminal but it eliminates the need to first convert the pdf file to a text file and then to open that in a capable text editor:

pdfgrep

In addition to the features listed in Synaptic, you can search multiple files and recursively. One big difference from regular grep is that pdfgrep doesn't provide line numbers but page numbers. man pdfgrep has details.

A simple example:

pdfgrep -in PATTERN FILENAME

Here, i is for case-insensitivity and n gives the page number, not line number.

An example of the output looks like:

pdfgrep output

There's a brief YouTube video, Pdfgrep - Search Text Inside PDF Files - Linux CLI , as well.

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.