How do I specify the " character as a delimiter in FOR
Posted: 06 Feb 2008 13:13
I want to parse a string with FOR /F where the delimiter character is the double-quote character (i.e. ")
for example, the contentes of C:\temp.out is:
name = "Joe"
I want to use something like
FOR /F "tokens=1,2 delims=^"" %%I in (temp.out) do @echo =%%J
and I'd like it to print
Joe
But I can't get FOR to treat " as a delimiter. I tried to escape it with ^", but no luck.
Any ideas?
Thanks.
for example, the contentes of C:\temp.out is:
name = "Joe"
I want to use something like
FOR /F "tokens=1,2 delims=^"" %%I in (temp.out) do @echo =%%J
and I'd like it to print
Joe
But I can't get FOR to treat " as a delimiter. I tried to escape it with ^", but no luck.
Any ideas?
Thanks.