@echo off
set /p before=请输入前面的字符
set /p after=请输入后面的字符
for /f “delims=” %%i in (1.txt) do (
if “%%i”==”” (
echo.>>2.txt
) else (
echo %before%%%i%after%>>2.txt
)
)
ren 2.txt 1.txt
时间: 2024-10-22 16:24:35
@echo off
set /p before=请输入前面的字符
set /p after=请输入后面的字符
for /f “delims=” %%i in (1.txt) do (
if “%%i”==”” (
echo.>>2.txt
) else (
echo %before%%%i%after%>>2.txt
)
)
ren 2.txt 1.txt