aariel_us
Any idea how to use a double quote as a delim character?
It appears that the only way to do it is with:
Code: Select all
delims=*"
I tried these two, but they don't work:
Code: Select all
delims=""
delims=^""
on "token... delim=..."
Code: Select all
FOR /F "tokens=2,6,8 delims="" %%G IN (.\foobar.txt) DO ECHO "%%G" "%%H" "%%I"
Code: Select all
foo("foobar","Foo Bar"){"FOOBAR"="cn=Foo Bar,ou=Foo,dc=foo,dc=bar"}
----------------------------
#2 30 Jul 2009 10:52
bluesxman
I'm going to go out on a limb here and say I don't think it's possible.
For that line of data I'd probably do something like this (untested):
Code: Select all
for /f "usebackq tokens=1,2,3 delims=(){}" %%a in ('foo("foobar","Foo Bar"){"FOOBAR"="cn=Foo Bar,ou=Foo,dc=foo,dc=bar"}') do (
set "token1=%%~a"
for /f "usebackq tokens=1,2 delims=," %%A in ('%%b') do (
set "token2=%%~A"
set "token3=%%~B"
)
for /f "usebackq tokens=1* delims==" %%A in ('%%c') do (
set "token4=%%~A"
set "token5=%%~B"
)
)
Last edited by bluesxman (30 Jul 2009 11:13)
cmd | *sh | ruby | chef
----------------------------
#3 30 Jul 2009 11:30
jumper
Code: Select all
@echo off
FOR /F "delims=" %%x IN (data.txt) DO (
set V=%%x
call set V=%%V:"=µ%%
FOR /F "tokens=2,6,8 delims=µ" %%G IN (
'call echo.%%V%%'
) DO ECHO "%%G" "%%H" "%%I")
)
pause
----------------------------
#4 30 Jul 2009 14:02
aariel_us
Thanks jumper!
----------------------------
#5 13 Mar 2014 17:24
nodelord
This is how to do it using the brakout chr ^
Code: Select all
for /f tokens^=2^ delims^=^" %a .....