我写的,供参考- @echo off & setlocal enabledelayedexpansion
- for /f "delims=" %%i in (1.txt 2.txt) do (
- set line=%%i
- if "!line:┃=!" neq "!line!" (
- set word=%%i
- if "!#%%i!" neq "" (
- set old=!#%%i!
- set oldnum=!old:*┃=!
- set oldnum=!oldnum:┃=!
- set num=!line:*┃=!
- set /a num=!num:┃=!+oldnum
- for %%a in (┃!oldnum!┃) do set "#!old!=!old:%%a=! ┃!num!┃"
- ) else (
- set "#%%i=%%i"
- )
- ) else (
- set "_!word!ext%%i=%%i"
- )
- )
- for /f "tokens=1* delims==" %%i in ('set #') do (
- set word=%%i
- echo;%%j
- for /f "tokens=2 delims==" %%a in ('set _!word:~1!ext 2^>nul') do (
- echo; %%a
- )
- )
- pause & exit /b
复制代码
|