So I'm trying to loop over a bunch of PDF files, grab their character count and divide that by 5. So output should be something like this:
PDF1.pdf
400
PDF2.pdf
1000
Assuming PDF1.pdf
has 2000 characters and PDF2.pdf
has 5000 characters. This is what I'm currently doing:
for %%f in (*.pdf) do (
echo %%~nf.pdf
pdftotext %%~nf.pdf -enc UTF-8 - | wc -m
)
What I really seek help with, is grabbing the value from wc -m
, divide that by 5 and echo it out.
I've tried various things such as SET /A total=(wc -m) / 5
but nothing really seems to work out.