i have created a .cmd file which takes file name as argument then it asks for string to find and then string to replace.
desired out put
findthis should be replaced from given file with replacewith but it is not working
following is code which i have tried..
@echo off
setlocal enabledelayedexpansion
if not exist "%1" (echo this file does not exist...)&goto :eof
set /p findthis=find this text string:
set /p replacewith=and replace it with this:
for /f "tokens=*" %%a in (%1) do (
set write=%%a
if %%a==%findthis% set write=%replacewith%
echo !write!
echo !write! >>%~n1.replaced%~x1
)
thanks