I had an answer to my question previously, but now I've realised that i need a bit more help. I have code that does almost everything I want it to:
@echo off
copy 2.txt 2.txt-backup
setlocal enableDelayedExpansion
>2.txt (
for /f "delims=" %%A in (2.txt-backup) do (
set "ln=%%A"
if "!ln:~0,6!" == "Class=" findstr /c:"ClassName=!ln:~6!" 1.txt >null && set "ln=Class=ShipDummy"
echo !ln!
)
)
Please refer to this: Batch - I would like to search with a variable in one file and replace that variable result in another file
But now I've realized I need 1.txt to be a file name with a variable in its name, a series of files, with no exact limit like:
Log_0.txt
Log_1.txt
Log_2.txt
Log_3.txt
and so on....
There may be just Log_0.txt, or there may be Log_0.txt through Log_23.txt, or even more...
Also, I'd like to add another line to the replacement text of Class=ShipDummy to be: Class-ShipDummy Type=206
And that would replace a line of text just below Class=ShipDummy replacement text with Type=206.\