I have the following text in my file
---BEGIN TEXT---
any text1
anytext2
anytext3
---END TEXT---
---BEGIN TEXT---
any text4
any text5
---END TEXT---
I want to remove the 2nd text block from "---BEGIN TEXT---"
to "---END TEXT---"
How I can make that with a linux command
So my file will contains only:
---BEGIN TEXT---
any text1
anytext2
anytext3
---END TEXT---
I know how to remove the 1st block with the following command:
sed -n '/BEGIN TEXT/,/END TEXT/{p;/PAT2/q}' file.txt
How I can modify my sed
comand to remove the 2nd part and not the first part? or use another command like awk
?