Ok, it's working now.
I learned a little about grep and awk commands, and had to change one part of the code in this line:
x=`egrep -o 'Vencimento ..\/..\/....' "$path"/"_extract.txt" | awk '{print $2}'`
it was $3 before.
Worked like magic.
The only thing is the PDF has to be searchable, or it won't get the text from it. I got errors in the last 2 files I tried because they weren't OCR'd, despite the fact that they are from the same utility company, same format, etc. Go figure.