Skip to content

Search PDF files for all occurrences of a string

License

Notifications You must be signed in to change notification settings

CelestineKao/pdf-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pdf-search

Script for pulling each line in a set of PDFs that contains a matching string from a list of specified strings. Initial use case was to enable being able to quickly pull out rows in tables that contain a match. See example/.

How to use

Note: These instructions are written for MacOS (>= Sierra) and assumes basic command line familiarity

Requirements

Assuming you have homebrew installed, install pdfgrep:

brew install pdfgrep

This make take a minute or two.

Running the script

  1. Download search_pdfs.sh and put it into the same directory as the PDFs you want to search.
  2. cd into that directory and run chmod u+x search-pdfs.sh to make it executable.
  3. Create a text file in the directory called search_strings.txt. It should contain all the strings you want to search, one string per line. See the example search_strings.txt.
  4. Run ./search-pdfs.sh.
  5. Once it completes, there should be a new file called results.txt in the directory containing all the matched lines. See the example results.txt.

About

Search PDF files for all occurrences of a string

Resources

License

Stars

Watchers

Forks

Languages