谢谢版主,我也学会了,稍作了下改动,使之不会丢掉前三列后面的空格
而且精简了
第一个for 丢弃
第二个for 丢掉前空格和后空格
@echo off
cd.>test1.txt
for /f "tokens=1-6 delims= " %%a in (test.txt) do (
for /f "tokens=*" %%g in ("%%a%%b%%c%%d%%e%%f") do (
echo/%%~nxg>>test1.txt
)
)
type test1.txt
pause
goto :eof
[ Last edited by netbenton on 2009-1-28 at 02:42 ]
而且精简了
第一个for 丢弃
第二个for 丢掉前空格和后空格
@echo off
cd.>test1.txt
for /f "tokens=1-6 delims= " %%a in (test.txt) do (
for /f "tokens=*" %%g in ("%%a%%b%%c%%d%%e%%f") do (
echo/%%~nxg>>test1.txt
)
)
type test1.txt
pause
goto :eof
[ Last edited by netbenton on 2009-1-28 at 02:42 ]

