My batch script is supposed to replace content within a file or list of files, but doesn't work and unfortunately exits cycle loop...
Here the code:
@echo off
setlocal enabledelayedexpansion
set "int=000"
set "int_new=111"
for %%i in ("c:\text.txt") do (
jrepl "!int!" "!int_new!" /m /f "c:\text.txt" /o "c:\text_2.txt"
)
pause
It replaces the text but exit the script, could you explain where my mistake is?
Because
JREPLis a separate script from your script, when you runJREPLdirectly like that, the flow of your script transfers toJREPLand terminates whenJREPLdoes.If you want to come back to your script once the replacement is complete, use
call jreplinstead.