I'm sorry, maybe I'm too stupid. I've read all about this in the forum but still don't understand.
@echo off
echo Remove quotes:
call :replace 1.txt "
echo.
echo Replace characters:
call :replace 1.txt "Thank you" "Thank you"
pause>nul
goto :eof
:replace
setlocal ENABLEDELAYEDEXPANSION
for /f "tokens=1* delims=" %%i in (%1) do set var=%%i & echo !var:%2=%3!
endlocal
goto :eo
For this batch script, I just can't figure out what it means. Especially the part!var:%2=%3! in for /f "tokens=1* delims=" %%i in (%1) do set var=%%i & echo!var:%2=%3!. I don't understand the part about! either. Can someone give me some pointers? It's best to explain it with the above example. I looked at the help for the set command and didn't understand what the unary operator means... Thanks ah.
@echo off
echo Remove quotes:
call :replace 1.txt "
echo.
echo Replace characters:
call :replace 1.txt "Thank you" "Thank you"
pause>nul
goto :eof
:replace
setlocal ENABLEDELAYEDEXPANSION
for /f "tokens=1* delims=" %%i in (%1) do set var=%%i & echo !var:%2=%3!
endlocal
goto :eo
For this batch script, I just can't figure out what it means. Especially the part!var:%2=%3! in for /f "tokens=1* delims=" %%i in (%1) do set var=%%i & echo!var:%2=%3!. I don't understand the part about! either. Can someone give me some pointers? It's best to explain it with the above example. I looked at the help for the set command and didn't understand what the unary operator means... Thanks ah.

