Home Linux Community Forums Software Command Line help please: apply REGEX to multiple lines?

help please: apply REGEX to multiple lines?

Link to this post 02 Jan 11

hi friends! happy new year!
i never manage to do a regex includeing multiple lines, does anyone has an idea about that?

imagin you have a file


and you want to turn it into just


but without useing grep next line/line before
it needs to be something like:
sed -i "s#a\n(b\n)c\n#$1#g" file (which does not work)

thanks a lot

Link to this post 12 Jan 11

why not cat or grep ?
grep with regexp are easy ? is there a reason to avoid it ?

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board