Originally posted by namejm at 2007-5-17 21:14:
最完美的代码如下(来自23楼bjsh的代码,本人仅作少量改动):
代码3:
CODE:
--------------------------------------------------------------------------------
@echo off
cd.>output.txt
for /f "delims=" %%i in ('findstr /n .* test.txt') do (
set "var=%%i"
setlocal enabledelayedexpansion
set var=!var:*:=!
(echo.!var!)>>output.txt
endlocal
)
start output.txt
学习了,运行时报错,不过输出的txt却是正确的!
Last edited by different on 2008-12-23 at 01:43 ]
Originally posted by namejm at 2007-5-17 21:14:
The most perfect code is as follows (from the code of bjsh on floor 23, I only made a few changes):
Code 3:
CODE:
--------------------------------------------------------------------------------
@echo off
cd.>output.txt
for /f "delims=" %%i in ('findstr /n .* test.txt') do (
set "var=%%i"
setlocal enabledelayedexpansion
set var=!var:*:=!
(echo.!var!)>>output.txt
endlocal
)
start output.txt
Learned, an error occurred when running, but the output txt is correct!
Last edited by different on 2008-12-23 at 01:43 ]