I would like to ask you, how can I do this:
I have three files in folder, car.txt, bus.txt, plane.txt. File car.txt contains some text with string for example test="in_car" and I know, that I find word with prefix "in_" + word from filename "car" and if I find it, I want to replace it by word "hello". And for files bus.txt and plane.txt do same thing, find word in_bus and replace it by hello etc. And I know that prefix "in_" is only at this place.
Please, can you help me?
I try something like this:
for /R "../myFolder" %%f in (*.txt) do (
set FILENAME=%%~nf
set PREFIX=in_
set REPLACETEXT=hello
SET string=%%A
set modified=!string:%PREFIX%%FILENAME%=%REPLACETEXT%!
)
but it is not working and I don't know, how can I save it to current file (replace it in file)
%%Acomes from...