Set for /f delims as a line break

August 15, 2010 at 09:05:02
Specs: Windows XP
Hey I was coding a program when and wanted to set part of the ouput of a command as a variable so I used this code:

for /f "tokens=1 delims=" %%a in ('MY COMMAND') do (echo %%a)

But now the only problem is come commands ouput multiple lines of code and I don't know what to type for delims to mean a line break or a new line. So how could I code this to set the delims as a line break?

See More: Set for /f delims as a line break

Report •

August 15, 2010 at 11:29:47
I'll usually overcome that with a FINDSTR, Here's an example.

FOR /f "tokens=1 delims=" %%a IN ('Command ^| FINDSTR "String"') do (Command)

Hope I've Helped.

Report •
Related Solutions

Ask Question