Hey everyone,
I need help replacing “Banana”=dword:00000001” with “Banana”=dword:00000000″
inside a .txt
What I got so far is this
@echo off
setlocal enabledelayedexpansion
set INTEXTFILE=”C:\Temp\File.txt”
set OUTTEXTFILE=”C:\Temp\File_out.txt”
set SEARCHTEXT=”Banana”=dword:00000001
set REPLACETEXT=”Banana”=dword:00000000
for /f “tokens=1,* delims=¶” %%A in ( ‘”type %INTEXTFILE%”‘) do (
SET string=%%A
SET modified=!string:%SEARCHTEXT%=%REPLACETEXT%!
echo !modified! >> %OUTTEXTFILE%
)
The thing is that it gives the whole Output.
Only the replacement part is wrong.
Thats what it does in the line where it should replace the string
dword:00000001=”Banana”=dword:00000000=dword:00000001
Hope you can help me and many thanks already =)
message edited by CharlyT
If this doesn’t help, consider posting the actual .txt file you want to parse data from.
99 little bugs in the code,
99 little bugs.
Take one down, patch it around,
129 little bugs in the code.