I have a file with the output as below
--B32934--
descr: X
descr: Y
descr: Z
--B20484
descr: A
descr: B
descr: C
--B41946
descr: 1
descr: 2
descr: 3
descr: 4
I just need the --BXXXX number and the first line, the rest of the lines need to be stripped out from the file. Is it possible to delete the lines >1 based on the pattern match --B?
For example under "--B32934" i just want "descr:X". The rest of the lines need to be deleted.
Desired result should look like this
--B32934--
descr: X