3个回答
展开全部
@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
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
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
@echo off
setlocal enabledelayed expansion
set n=0
for /f "tokens=* delims=" %%i in (a.txt) do (
set /a n+=1
set !n!=%%i
)
变量全部给了行号
不包括空行
setlocal enabledelayed expansion
set n=0
for /f "tokens=* delims=" %%i in (a.txt) do (
set /a n+=1
set !n!=%%i
)
变量全部给了行号
不包括空行
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
例如
@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
@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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询