CODE: [Copy to clipboard]
@echo off & SETLOCAL EnableDelayedExpansion
set _TxtFile=a.txt
set _OutFile=2.txt
set _GetLine=
set _GetChar=
:main
if exist %_OutFile% copy %_OutFile% %_OutFile%.bak & del /q /f %_OutFile%
fsutil file Createnew %_OutFile% 0
for /f "Tokens=* " %%i in (%_TxtFile%) do (
set "_GetLine=%%i"
set "_OutLine="
set "_GetLine=!_GetLine:<a>=☆!"
set "_GetLine=!_GetLine:<a/>=★!"
call :READINFILE
echo !_OutLine! >>%_OutFile%
)
goto :END
:READINFILE
set ReadFlag=false
for /l %%i in (0,1,255) do (
set _GetChar=!_GetLine:~%%i,1!
if "!_GetChar!"=="" goto :EOF
if "!_GetChar!"=="★" set ReadFlag=false
if "!ReadFlag!"=="true" set _OutLine=!_OutLine!!_GetChar!
if "!_GetChar!"=="☆" set ReadFlag=true
)
goto :EOF
:END
[