I have database log file which looks like this
tbl
---
tmp1
col1|col2
---------
22| 33
32| 45
tbl
---
tmp2
col1|col2| col3
---------------
22| 33| 123
32| 45| 456
I am trying to write a sed command which find lines which begin with '---' and adds a carriage return two lines above. So that the output looks like:
tbl
---
tmp1
col1|col2
---------
22| 33
32| 45
tbl
---
tmp2
col1|col2| col3
---------------
22| 33| 123
32| 45| 456
Is it possible to do this using sed? If so how?