Hi all,
This is probably simple but for some reason I'm struggling to find an answer.
I'm hoping to use sed to replace a random string in a file that matches a string with something else.
Example, in the file.txt it contains various lines of text and also the lines I wish to change:
I'm looking to replace the last string in any lines matching: "string 'number 1' <string_to_be_replaced>"
So I want to come out with something like this:
Hope that makes sense.
Thanks... T
This is probably simple but for some reason I'm struggling to find an answer.
I'm hoping to use sed to replace a random string in a file that matches a string with something else.
Example, in the file.txt it contains various lines of text and also the lines I wish to change:
Code:
text
Telephone number 1 555-3232
more text
Telephone number 1 3432223
Fax number 1 4645787-344
more text etc
I'm looking to replace the last string in any lines matching: "string 'number 1' <string_to_be_replaced>"
So I want to come out with something like this:
Code:
text
Telephone number 1 XXXXXXX
more text
Telephone number 1 XXXXXXX
Fax number 1 XXXXXXX
more text etc
Hope that makes sense.
Thanks... T