I have a file in the following format:
--- V1 ---
Hi there
--- V2 ---
--- V3 ---
What's good
--- V4 ---
--- V5 ---
--- V6 ---
I want to use some kind of bash script to remove any of the lines beginning with three dashes that are not immediately followed by a line that does NOT have three dashes, e.g.:
--- V1 ---
Hi there
--- V3 ---
What's good
I can easily remove ALL of the lines beginning with dashes, but don't know how to do it based on the following line (or alternatively, based on the line preceding the non-dashed lines).