Originally Posted by atjurhs
hey guys, I have a directory with 20+ pdf files and I need to find info within 1 or more of them. the info will contain a specific string, let's say aBcDeFg. I know
[code\] grep -isnr aBcDeFg *.pdf [code]
won't work. is there something that will grep thru a bunch of pdf files?
First, the CODE tags are [ CODE] to start, and [/ CODE] to stop.
As far as your issue goes, try pdftotext, which will convert that PDF file into text...which you can then pump through grep for a string. A simple loop:
for file in /pdf/path/*.pdf; do pdftotext "$file"; done
..will convert them all into text. Change the 'pdftotext' to be your grep:
for file in /pdf/path/*.txt; do grep aBcDeFg "$file"; done