批处理:A.BAT
setlocal enabledelayedexpansion
for /f "delims=*" %%i in (源文件.txt) do (
set val=%%i
call :ss
)
:ss
echo !val:~0,3!>>输出.txt
goto:eof
源文件:源文件.txt
19 2 8 8 8.168 888.0888.1888
29 3 8 8 8.178 888.0888.1888
39 4 8 8 8.188 888.0888.1888
19 5 8 8 8.198 888.0888.1888
59 6 8 8 8.108 888.0888.1888
输出结果
19
29
39
19
59
59
问题
输出结果总是有6行(应该是5行),即最后一行总是重复的?为什么?
另外,如何解决?
[ Last edited by bd123456789 on 2008-1-20 at 05:12 PM ]
setlocal enabledelayedexpansion
for /f "delims=*" %%i in (源文件.txt) do (
set val=%%i
call :ss
)
:ss
echo !val:~0,3!>>输出.txt
goto:eof
源文件:源文件.txt
19 2 8 8 8.168 888.0888.1888
29 3 8 8 8.178 888.0888.1888
39 4 8 8 8.188 888.0888.1888
19 5 8 8 8.198 888.0888.1888
59 6 8 8 8.108 888.0888.1888
输出结果
19
29
39
19
59
59
问题
输出结果总是有6行(应该是5行),即最后一行总是重复的?为什么?
另外,如何解决?
[ Last edited by bd123456789 on 2008-1-20 at 05:12 PM ]
