Solved FOR /F tokens=2 delims= problem

February 2, 2015 at 05:03:12
Specs: Windows 7
I'm trying to read a value from a line in a text file. The line is PathID ( "NS_B_W" ) I need to get the value NS_B_W The FOR command I'm using is For /F "tokens=2 delims="" %%i in (Temp111.fil) do set Temp22=%%i I get this error 'The syntaxt of the command is incorrect'. Changing delims="" to delims= " for example gives a value of ( The command works I just need to find what to use for " as "" gives an error. Any ideas of what can be used as a substitution for " in the delim value? Thanks!

See More: FOR /F tokens=2 delims= problem

Report •

February 2, 2015 at 05:33:12
✔ Best Answer
for /F "tokens=3" %%i in (Temp111.fil) do set Temp22=%%i
set Temp22=%Temp22:"=%

Report •

February 2, 2015 at 10:41:19
Thanks Ivo! That solved my issue. I get the exact value needed.

Report •

Related Solutions

Ask Question