Help with sed
Hi All,
I am beginning my way into sed, I want to do the following: I have a file "file" which contains few lines. I have two different words in two different lines (word1 in line 1 and word2 in line 4) which I need to change to be "change1" in line 1, and "change2" in line4. They should be replaced in the same file, i.e. keep the file name intact "file". How would I do that? Here is exactly what I want: Code:
void FV(string infile = "test2.xxx", Thank you so much in advance, faizlo |
I have called your file tsed - this will make the changes in place. Note the changes will not be confined to lines 1 and 4 but as I take it the searched expressions are unique this will be OK :
Code:
|
It worked, Thank you so much,
faizlo |
Yes, but do you understand why it worked ?.
|
Quote:
I would hope that those asking for help would maybe have hit a "brick wall" in their trials and so need assistance or guidance. Our solutions are all offered freely in the spirit of helpfulness and to further knowledge but lets hope the enquirers are not just taking advantage of this for an easy ride. |
Quote:
|
I note the OP has now taken this answer and started a new thread with it. Appears prepared to learn.
|
All times are GMT -5. The time now is 06:08 AM. |