@echo off
rem test.txt
echo 11 12 13 14 15 16 >>test.txt
echo 21,22,23,24,25,26 >>test.txt
echo 31-32-33-34-35-36 >>test.txt
for /f "eol=; tokens=1,3* delims=,-" %%i in (test.txt) do echo %%i %%j %%k
pause
del test.txt
怎么让12不显示
@echo off
rem test.txt
echo 11 12 13 14 15 16 >>test.txt
echo 21,22,23,24,25,26 >>test.txt
echo 31-32-33-34-35-36 >>test.txt
for /f "eol=; tokens=1,3* delims=,-" %%i in (test.txt) do echo %%i %%j %%k
pause
del test.txt
怎么让12不显示
只需要一个很小的改动。。分隔符加上一个空格就可以了。
for /f "eol=; tokens=1,3* delims=,- " %%i in (test.txt) do echo %%i %%j %%k