bat替换指定行的内容中,指定的字符串
发布网友
发布时间:2022-04-24 05:02
我来回答
共1个回答
热心网友
时间:2023-08-15 20:10
@echo off&setlocal enabledelayedexpansion
set "s=aa"
set "d=haha"
(for /f "delims=" %%a in (1.txt) do (
set "str=%%a"
if not defined a (
if not "!str:%s%=!"=="%%a" (
set str=!str:%s%=%d%!
set a=.
)
)
echo,!str!
))>2.txt