Hi I'm an awk newbie and I need help with a problem.
I have some files in which I need to match a certain pattern, skip two lines and then replace the current line (after skipping) with something e.g.
...
line a ("tom") <-- tom is the pattern to be found
line b blah blah <-- to be skipped
line c blah blah <-- to be skipped
line d ("finn") <-- replace finn with sawyer
...
Please note that there are lines before and after line a and d respectively. Also, I cannot go directly to finn since I do not know the value before hand (the double quotes are in the file). Any help is much appreciated.
I have some files in which I need to match a certain pattern, skip two lines and then replace the current line (after skipping) with something e.g.
...
line a ("tom") <-- tom is the pattern to be found
line b blah blah <-- to be skipped
line c blah blah <-- to be skipped
line d ("finn") <-- replace finn with sawyer
...
Please note that there are lines before and after line a and d respectively. Also, I cannot go directly to finn since I do not know the value before hand (the double quotes are in the file). Any help is much appreciated.