Hi everyone,
I have a text file (for example: data.dat) as shown below, with a number of lines.
data.dat@motion parametersspeed= 22,30,60range= 600rotation= 50@controlsact= 2,3,4,5
I want to read it and replace the line that comes right after the line starting with a specfic keyword e.g. "@controls" . In this case, the line to be replaced is this one
act= 2,3,4,5
and it should be changed in a loop. For an instant, for example, it would change to:
act= 1,0,8,-2
I'd appreciate your help. Thanks in advance.
Best Answer