Hi,
just to be clear:
After processing there will be two files. The original file which has been altered and a new additional file, right?
Code:
$ cat file
no removal
example
Random text Random textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom text
example
no removal
$ cat file
no removal
no removal
$ sed -i '/^example/ {:a N; /\nexample/! ba;w newfile
d}' file
$ cat newfile
example
Random text Random textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom textRandom text
example
[EDIT]
I just see that you modified your requirement with your last post. Post some represantative samples of what the actual data looks like and what it is supposed to look after processing.