sed: Find pattern and delete 5 lines after it
Hello all
I am trying to edit a print file. For every occurence of the ^L form feed character I need to remove 5 blank lines after it but still keep the ^L. I am a rare user of sed and am ok with the basics but am struggling with this. Can anybody point me in the right direction please? Many thanks Paul |
Code:
sed '/<regex>/{p;N;N;N;N;N;d}' <file> |
slight change worked for me:
Code:
sed -i '/<regex>/{n;N;N;N;N;d}' <file> |
Thank you both - PMP suggestions worked ok for me.
|
Don't forget to mark as SOLVED
|
All times are GMT -5. The time now is 01:16 PM. |