本帖最后由 aloha20200628 于 2024-10-31 23:24 编辑
回复 1# TXTUSER
匹配范围》原文.txt 每行可能出现的两种类型函数表达式中的一种,如下示例:
AD=MAX(A,B)+MAX(C,D)
XY=MIN(A,C)- @echo off &setlocal enabledelayedexpansion
- (for /f "tokens=1-6 delims=(,)" %%a in (
- 'findstr /i "([a-z][a-z]*,[a-z][a-z]*)" 原文.txt') do (
- set "s=%%a(_%%b,_%%c)" &if "%%d" neq "" set "s=!s!%%d(_%%e,_%%f)"
- for /f "tokens=1-2 delims==" %%x in (
- 'findstr /i "%%b= %%c= %%e= %%f=" 《字典》.txt') do set "s=!s:_%%x=%%y!"
- echo,!s!
- ))>"原文.new.txt" 2>nul
- type "原文.new.txt"
- endlocal&pause&exit/b
复制代码
|