Imagine a text file something like the following:
Case 4
case 4.1
a 3
a 5
a 7
a 1
a 9
a 4
endcase 4.1
//
.
.
. Do things that dont get parsed
.
.
//
case 4.2
a 1
b 3
a 6
b7
endcase 4.2
endcase 4
//
.
.
.
. More things
.
.
//
case 5
.
.
.
.
endcase 5
which contains the values of multiple variables at different points in time. Eg, case 4 concerns variable a and b. How do I extract only the lines between say case 4.1 and endcase 4.1?
You can use awk, for example: