I have a text file (lets call it file1.txt), it contains the following lines: "read model $path_1"
How do I replace the value of path_1 variable in this text file and write it to another file (lets call it file2.txt) with same contents but $path_1 variable expanded. My file2.txt should contain something like the following: "read model /home/Aero/test"
Is there any parser in python available to do this job? I looked into ConfigParser module but looks to me that it needs a config file with variable=value pair.
Regards, Sandhya