On Fri, 05 Jun 2009 21:31:59 -0000, "Ryan Johnson"
<
ryan.johnson@...> wrote:
>I have a text file that looks like this:
>
>PO_NUMBER=RJ12346
>
EMAIL=email@...
>
>I want to extract both rows to be used in the text file. How can I do this? I need to dynamically put in the email address and PO Number in the command line.
>
>c:\sendmail.bat -r %EMAIL% -s "PO %PO_NUMBER% Received" -t "PO %PO_NUMBER% Received"
@echo off
for /f "tokens=1,2 delims==" %%a in ('type "file.txt"') do (
if /i "%%a"=="PO_NUMBER" set "PO_NUMBER=%%b"
if /i "%%a"=="EMAIL" set "EMAIL=%%b"
)
:: the line below is wrapped
call c:\sendmail.bat -r %EMAIL% -s "PO %PO_NUMBER% Received" -t "PO
%PO_NUMBER% Received"
pause