Hi all
I have been googling for ages but with no prevail hence this new thread.
I would like to add a new line after a particular text string. For example, assume the original file contains the following text:
..
line1
line2
line3
..
I would like to insert the text string "additional_text" inbetween "line2" and "line3" so file will contain the following:
..
line1
line2
additional_text
line3
..
I have tried the following sed command with no luck:
sed -e 's/line2/line2\nadditional_text/g' original_file > new_file
Does anyone know what I should do?
Thanks very much
Robbie