我有一个包含很多字符的test.txt。但是,我需要更换全部。至 /。我怎样才能做到这一点?我尝试使用以下代码:
@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
有人可以帮助我吗?