- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in (a.txt) do (
- set "v=%%i"
- set "v=!v:第=!"
- for /f "tokens=* delims= " %%i in ("!v!") do (
- set "s=%%i"
- set "s2=!s:~1,1!"
- call set "x=%%v:!s!=%%"
- if !s2! equ 章 (echo !x!第%%i) else echo !x!%%i
- )
- )
- pause
复制代码
|