I have many files that are name "12739-5468768.xml", what they have in common is the "12739", inside these files I want to replace every &
with " AND " and every </
with nothing. I tried many commands and python command but it doesn't seem to operate on my computer.
@echo off
setlocal
setlocal enabledelayedexpansion
set "search=&"
set "replace= AND "
set "textfile=12739*"
set "newfile=Output.txt"
(
for /f "delims=" %%i in (%textfile%) do (
set "line=%%i"
set "line=!line:%search%=%replace%!"
echo(!line!
)
) > "%newfile%"
del %textfile%
rename %newfile% %textfile%
endlocal