Can anyone advise me on how to code a sed script that can be used to update a text file as follows:
Each time a line in the file containing the character string 'Header_one' is encountered: - delete the lines that immediately follow the 'Header_one' line until the next blank line is encountered. - but dont delete the 'Header_one' line itself
So as an example, a file containing this:
Header_one
dkrjng
djsje
Header_two
cklrgjsj
djrhg
Header_one
drgbyj
efgjjm
cddess
Header_three
sdfvgg
ddddfy
Would be changed to:
Header_one
Header_two
cklrgjsj
djrhg
Header_one
Header_three
sdfvgg
ddddfy
I would be grateful for any guidance or solution. Thanks, James.