I'm wanting to edit identical text in a large number of text files using a batch file. This sample code is attempting to test the principle. But all it does is open the text file.
any advice welcome.
mark
any advice welcome.
mark
Code:
@echo off
setlocal enabledelayedexpansion
if not exist "%1" V:\Mark\VBA_Excel\BATCHTEST\New.txt &goto :eof
set /p findthis=BOB:
set /p replacewith=FLUTE:
for /f "tokens=*" %%a in (%1) do (
set write=%%a
if %%a==%findthis% set write=%replacewith%
echo !write!
echo !write! >>%~n1.replaced%~x1
)