for loop -> Pipe - not working
Posted: 03 Jun 2020 09:31
Hi Folks -
I"m trying to pipe the results of a text file to a FIND command to return the found string. I have this code but it's returning everything after the second delim, regarding if its the correct string I'm passing in as the search mask.
Any idea?
Variablefile.txt looks like this:
I"m trying to pipe the results of a text file to a FIND command to return the found string. I have this code but it's returning everything after the second delim, regarding if its the correct string I'm passing in as the search mask.
Any idea?
Code: Select all
FOR %%A IN ( "StartMonth" ) DO (
FOR /F "tokens=2 delims==" %%a IN (C:\TEMP\variablefile.txt ^| FIND "%%~A") DO (
echo %%a
)
)
pause
Code: Select all
StartMonth=Apr
Year1=2020