In a report file generated from Quartus, there are multiple "tables" like the following:
+---------------------+
; Section1 Title ;
+---------------------+
Miscellaneous text
+-----------------+
; Table1 Header ;
+--------+--------;
; Field1 ; Field2 ;
; Field3 ; Field4 ;
+--------+--------+
Table notes
+------------------------+
; Table2 Header ;
+---------------+--------;
; Longer Field1 ; Field2 ;
; Longer Field3 ; Field4 ;
+---------------+--------+
+---------------------+
; Section2 Title ;
+---------------------+
Miscellaneous text
NOTE: There is always a blank line between sections and tables.
I want to be able to print out just one full table like the following based on it matching the "Table Header".
+-----------------+
; Table1 Header ;
+--------+--------;
; Field1 ; Field2 ;
; Field3 ; Field4 ;
+--------+--------+
Table notes
We currently use the following combination of a grep to print out the beginning table line and a sed to print the rest, but it seems like I should be able to do it all with just sed.
grep -h -B 1 "; Table1 Header" quartus.rpt | grep -v "; Table1 Header"
sed -n '/; Table1 Header/,/^$/p' quartus.rpt