第1个回答 2010-05-28
@echo off & setlocal EnableDelayedExpansion
set j=0
for /f "delims=""" %%i in (a.txt) do (
set /a j+=1
set con!j!=%%i
call set a=%%con!j!%%
echo !a!
)
pause本回答被提问者和网友采纳
第2个回答 2010-05-28
@echo off
setlocal enabledelayed expansion
set n=0
for /f "tokens=* delims=" %%i in (a.txt) do (
set /a n+=1
set !n!=%%i
)
变量全部给了行号
不包括空行
第3个回答 2010-05-28
例如
@echo off&setlocal
set n=0
for /f "delims=" %%i in (a.txt) do (
set/a n+=1 &call set f%%n%%=%%i )
call set aa=%%n%%
for /L %%j in (1,1,%aa%) do (call echo f%%j=%%f%%j%% )
pause