
CODE: [Copy to clipboard]for 解析文件时默认会自动忽略;开头的所有行for /f "delims=" %%i in (data.txt) do set/a a+=1&call set A_%%a%%=%%i
CODE: [Copy to clipboard]要求变量少于26个,for解析时,依次把1、2、3赋值给a、b、c。。。@echo off&setlocal enabledelayedexpansion
set han=寒abcdefghijklmnopqrstuvwxyz夜孤星
for /f "delims=" %%i in (data.txt) do set/a n+=1&call set %%han:~!n!,1%%=%%i
CODE: [Copy to clipboard][ Last edited by Hanyeguxing on 2010-3-20 at 21:11 ]@echo off&setlocal enabledelayedexpansion&set n=1
for /f "delims=" %%i in (data.txt) do call :a "%%i" "a" "a b" "i d f"
pause&exit
:a
set /a n+=1&call set "%%~!n!=%~1"
goto :eof
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |