npocmaka
Basically FOR /F cannot use a new line as delimiter
- it can be worked around with counting lines and etc. ,but here's something else that I want to try.But it does not work and I don't know why:
Code: Select all
@echo off
for /f "delims=¦ tokens=1,2" %%O in ('
@echo off ^&
for /f "usebackq tokens=*" %%I in ^(^`
ipconfig
^`^) do ^(
^<nul set /p ".=¦%%I"
^)
') do (
echo %%O
)
If I use * in tokens parameter it works.
I've wondered if there's not visible LF or CR symbol that was not escaped ,but I've checked the produced string with a HEX editor and didn't saw such thing.
. Any ideas?
----------------------------
#2 22 Dec 2012 02:28
dbenham
Don't groan too loadly....
Each line becomes a token, but you forgot to print out the 2nd token
Code: Select all
@echo off
for /f "delims=¦ tokens=1,2" %%O in ('
@echo off ^&
for /f "usebackq tokens=*" %%I in ^(^`
ipconfig
^`^) do ^(
^<nul set /p ".=¦%%I"
^)
') do (
echo %%O
echo %%P
)
----------------------------
#3 22 Dec 2012 10:38
npocmaka
Aghh... I'm such an idiot.