|
best method to replace data in a text file?
Dear all,
I think most people may face a problem to write scripts to replace data in the some config files.
For example, I have a file "profile.txt". It contains:
name="John"
phone="123456"
If I want to change the name to "Peter". Now, I only know to use sed.
But I found that sed can't feed the output back to the original file.
And I hope to do the things like searching the name tag and replacing its value.
Which tools can fulfill my hope? or sed can already do this job?
|