Last active
August 29, 2015 13:56
-
-
Save tobius/8865878 to your computer and use it in GitHub Desktop.
Convert a batch of pdf files into a single text dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
##---------------------------------------------------------------------## | |
## Convert a batch of pdf files into a single text dump ## | |
## @author Toby Miller <tobius.miller@gmail.com> ## | |
## ## | |
## setup: brew install xpdf ## | |
## usage: cd pdffolder && batchpdftotext [out.txt] ## | |
##---------------------------------------------------------------------## | |
if [[ -z "$1" ]] | |
then | |
find . -type f -name '*.pdf' -exec pdftotext -raw {} /dev/stdout \; | |
else | |
(find . -type f -name '*.pdf' -exec pdftotext -raw {} /dev/stdout \;) > "$1" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment