i want to search a substring in a File and replace it by another. in the following example, i want to replace a username by another.
in the bla.cfg stands for example:
ClearErrors
FileOpen $fp '$INSTDIR\bla.cfg' r
IfErrors notopen 0
pop $R0
FileRead $fp $R0
FileClose $fp_zedas.cfg
CopyFiles /FILESONLY '$INSTDIR\temp' '$INSTDIR\etc'
notopen:
[Point]
username = test
password = testuser
[Point2]
loglevel = 0
Logfile= ../log/logging.log
Ok, with fileread i get the file line by line and i musst loop, thats clear. but to find the unsername i can only search by username, because the line can also be "username = dog" etc. ... and not by the complete line.
if i have the line, i musst raplace the complete line by my new entry "username = $username".
Can anybody help my?