@echo off
for /f "tokens=* delims= " %%f in (myfile) do (
set line=%%f
call :processToken
)
goto :eof
:processToken
for /f "tokens=1* delims=/" %%a in (%line%) do (
echo Got one token: %%a
set line=%%b
)
if not "%line%" == "" goto :processToken
goto :eof
在我的文本文件中,我有类似的行
"test a","test b","testdim"
"Line 2", "test d","testdin"
所以当我看到for /f "tokens=1* delims=/" %%a in (%line%) do (
ECHO ON 时,%line% 显示为"test a" "test b" "testdim"
.
我不知道为什么缺少逗号,但我需要这些逗号以便我可以使用"delims=,"
这些值从每一行中获取。