Created
November 10, 2011 23:35
-
-
Save padenot/1356633 to your computer and use it in GitHub Desktop.
pdfwc
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/sh | |
if [ $# -eq 0 ] | |
then | |
echo "$(basename $0) [-w|-c|-l|-L]? file.pdf+" | |
echo "\t-w : count words" | |
echo "\t-c : count characters" | |
echo "\t-l : count lines" | |
echo "\t-L : maximum line length" | |
exit 1 | |
fi | |
wcopt="" | |
for i in -w -c -l -L | |
do | |
[ "$1" = "$i" ] && wcopt="$wcopt $i" && shift | |
done | |
pdftotext $* - | egrep -E '\w\w\w+' | wc $wcopt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment