Code: Select all
TEMPLATE = Test
Test = \
Test1 \
Test2
Code: Select all
@echo off
set oldText1=Test1 \
set oldText2=Test2
set newText1=newTest
set newText2=
setlocal enableDelayedExpansion
for /F "tokens=1* delims=]" %%j in ('type "Test.tmp" ^| find /V /N ""') do (
if "%%k"=="" (
echo.
) else (
set "line=%%k"
set "line=!line:%oldText1%=%newText1%!"
set "line=!line:%oldText2%=%newText2%!"
if not !line!==[] echo !line!
)
)
endlocal
Code: Select all
TEMPLATE = Test
Test = \
newTest
ECHO is off.