Created
February 2, 2015 22:14
-
-
Save Telling/7b5ebaba6497e4d8c821 to your computer and use it in GitHub Desktop.
count stuff with pdftotext
This file contains hidden or 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
# Count how many pages approximately in PDF (1 page = 2400 chars) | |
pagecount() { | |
echo $(( $(pdftotext "$*" - | tr -d '.' | wc -m) / 2400.00 )) | |
} | |
# Count characters in PDF | |
charcount() { pdftotext "$*" - | tr -d '.' | wc -m } | |
# Count words in PDF | |
wordcount() { pdftotext "$*" - | tr -d '.' | wc -w } | |
# Count lines in PDF | |
linecount() { pdftotext "$*" - | tr -d '.' | wc -l } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment