
CODE: [Copy to clipboard]想根据文本a.txt里面的数值进行判断,但运行没有输出,为什么?REM START
for /f "delims=" %%j in ('type a.txt') do (
set /a i=%%j
echo %i%
if "%i%" == "1" (
echo txt=1
)
if "%i%" == "2" (
echo txt=2
)
if "%i%" == "3" (
echo txt=3
)
)
REM END
>type a.txt
1
CODE: [Copy to clipboard]@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%a in ('type a.txt') do (
set "i=%%a"
echo.!i!
for /l %%b in (1 1 3) do (if "!i!"=="%%b" echo txt^=%%b)
)
echo.&pause
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |