Replace Data in a file using Perl or any other utility
I have a file with text that I need to find and replace. The text is not always the same but it does have a consistent method for searching. For instance the text would be machine: NNN where NNN would change. I want to replace machine: NNN with machine: myname.
How do i perform a search and replace for inconsistent data and replace it with consistent data.
With perl I would use perl -p -i -e 's/machine:./machine:myname /g' ALLJOBS.08.txt
The problem with this is it doesn't replace the original machine names just appends the new name to the original name.
|