New line as a delimeter of FOR loop
问题 I am new to batch script, and I am trying to parse a file that has key value (kind) of pairs delimited by new line. For example: the value of abc 1234 the value of def 5678 the value of ghi 9876 I would like to read this file using new line as delimited so that I can access the values. Something like for /f "tokens=1,2,3 delims='\n'" %%i in ('findstr /C:the value of abc 'filepath') do echo %%j 回答1: You can't set 'new line' as delimiter. Try this: @echo off &setlocal for /f "tokens=1*delims=:"