- @echo off&setlocal enabledelayedexpansion
- set .(名字小猫-动物)=英文(cat)
- set .(名字小狗-动物)=英文(dog)
- set .(名字小猪-动物)=英文(pig)
- set .(名字小鸟-动物)=英文(brid)
- set .(名字小鸡-动物)=英文(chicken)
- for /f "delims=" %%i in (a.txt) do (
- for /f "tokens=1* delims==" %%j in ("%%i") do set str=%%j%%k
- if defined flag (
- for %%a in (!flag!) do set var=!.%%a!
- if "%%i"=="!var!" (echo !flag:名字=名字=!=%%i 正确) else (
- echo !flag:名字=名字=!=%%i 错误。。。。。。
- )
- set "flag="
- )
- if defined .!str! set flag=!str!
- )
- echo;&pause
复制代码
|