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?
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.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |