I have text files generated by one of my tools with structure shown below.
1 line text
(space)
multiple
lines
text
(space)
multiple
lines
text
nr 2
---------------------------------------------------------- (58 - characters)
different 1 line text
(space)
different
multiple
lines
text
(space)
different
multiple
lines
text
nr 2
----------------------------------------------------------
different 1 line text
(space)
different
multiple
lines
text
(space)
different
multiple
lines
text
nr 2
----------------------------------------------------------
(space)
Each file begins with 1 line text and ends with - signs separator and space. There are different numbers of sections in each file and each section that is in the middle starts and ends with - signs. Below is what I would like to achieve.
multiple
lines
text
(space)
different
multiple
lines
text
(space)
different
multiple
lines
text
I would like to remove all one liners, all 58 - characters dividers and all second multiple liners and have only first multiple liners from each section one under another divided with spaces. Could someone recommend how to do it on linux? Any suggestions will help.