I have stitched, w/o any deeper cmd knowledge, a script that searches for certain string in specified files in a directory and replaces it with another. (at least should)
Goes like
set "search=readed"
set "replace=read"
set "myfiles=.\*.tex"
for %%f in (%myfiles%) do (
set /p val=<%%f
echo "fullname: %%f"
for /f "delims=" %%i in ('type %%f ^& break ^> %%f ') do (
set "line=%%i"
setlocal enabledelayedexpansion
>>%%f echo(!line:%search%=%replace%!)
endlocal
)
)
pause
Almost works. It has two issues. 1st - the less important: deletes whitespace lines. 2nd - deletes exclamations. before:
% !TEX root = TechRep.tex
after:
% TEX root = TechRep.tex
May I ask for a help? Thanks!