I have two files, Editor.m and Parameters.m. I want to write a code in Editor.m that when run does the following task:
- reads Parameters.m
- searches for a line in it (e.g. dt=1)
- replaces it with something else (e.g. dt=0.6)
- saves Parameters.m.
So, at the end of this process, Parameters.m will contain the line dt=0.6 instead of dt=1, without me having edited it directly.
Is there a way to do this? If so, how?