The following windows batch file will result in either a 1 or a 0. I am trying to get that 1 or 0 output into a variable so that I can use logic to do further processing:
@echo off
set page=1
pdftr.exe -searchtext "INFORME A LOS PADRES - KINDERGARTEN" -pagerange %page% in-whole.pdf' | 'find /C "Search keyword in page"
I thought I could do it like this based on other information found here on StackOverflow, however, I don't think that pipes are allowed because I get an error "| was unexpected at this time." Here is what I tried:
@echo off
set page=1
for /f %%i in ('pdftr.exe -searchtext "INFORME A LOS PADRES - KINDERGARTEN" -pagerange %page% in-whole.pdf' | 'find /C "Search keyword in page") do set RESULT=%%i
echo The result is: %RESULT%
Is there a way I can take my command and output the results (the 1 or 0) to a variable so I can use it in other logic within my batch file?
Also, just or some background, what I am ultimately trying to do is determine the grade level and language (english or spanish) of a pdf file, so that I can add an appropriate insert to the pdf using cpdf. But I am stuck on this part.