Post

How to count numbers from pdf

How to count numbers from pdf

It is possible to extract pdf text and get some valuable information out of it.

1
2
3
4
5
6
7
for i in $(ls *.pdf); do \
pdftotext $i - | grep -E '^\+.*(USD)$'; done \
| grep -Eo '[0-9]+,[0-9]+' --color \
| sed 's/,/./g' \
| awk '{s+=$1}END{print s}'

This post is licensed under CC BY 4.0 by the author.