更新时间:2023-08-29 09:03:46
此答案将在 3
和 5
之间添加 4
.
This answer will add a 4
between a 3
and a 5
.
@echo off
setlocal enabledelayedexpansion
ren in.txt in.tmp
set p=
for /f %%a in (in.tmp) do (
if "%%a"=="5" if "!p!"=="3" Echo 4 >> in.txt
Echo %%a >>in.txt
set p=%%a
)
del in.tmp