I have a test.txt with a lot of characters. However, I need to replace all of . to /. How can I do this? I tried using the follow code:
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET "sourcedir=C:\Users\HOME\Desktop"
SET "destdir=C:\Users\HOME\Desktop"
SET "filename=%sourcedir%\test.txt"
SET "outfile=%destdir%\outfile.txt"
(
FOR /f "usebackq delims=" %%a IN ("%filename%") DO (
SET "line=%%a"
SET "line=!line:.=/!"
ECHO !line!
)
)>"%outfile%"
GOTO :EOF
Anyone can help me, please?