Find word(s) in PDF and to Email via BAT

October 19, 2010 at 05:26:55
Specs: Windows XP
I'm a Batch virgin and need help to write a bat file that will read a PDF and if the PDF contains "No Existing Breaks", then I want to put that in my email. Or just a script that finds the phrase I'm looking for is good enough.

Appreciate the help.


See More: Find word(s) in PDF and to Email via BAT

Report •


#1
October 19, 2010 at 16:19:18
The simplest method would be:

TYPE "MyFile.pdf" | FIND "No Existing Breaks"
IF "%ErrorLevel%"=="0" (
ECHO Found
) ELSE(
ECHO Not found
)
PAUSE

I'm not sure about the out come of this though. The fact that it is a pdf might throw things off. Giv'er a try though.

Can I put a question here?


Report •

#2
October 20, 2010 at 01:29:10
I have no clue what I'm doing, so I really need the exact verbiage I'm to use. I need to search a PDF file "ReportOutcome.pdf" and if it contains the words "No Existing Breaks" I then need to generate a notepad file that will say "found" or "not found".


Report •

#3
October 20, 2010 at 04:27:14
TYPE "ReportOutcome.pdf" | FIND "No Existing Breaks" >Nul
IF "%ErrorLevel%"=="0" (
ECHO Found >Result.txt
) ELSE(
ECHO Not found >Result.txt
)
PAUSE

Again though, the fact that it is a pdf might throw it off. Let me know if it works for you. If not, I'll have to come up with something else.

EDIT: And it does. So, apparently batch files cant read pdfs. Uhm, I'm all out of suggestions, but I'm sure else someone here would be able to help.

Can I put a question here?


Report •
Related Solutions


Ask Question