I'm looking to extract all lines that begins with Start and its next line ends with ***.
Appreciate any help.
Example:
*********************************************
Start the extract for customer_id [XXXX-2359]
*********************************************
Start the extract for customer_id [XXXX-2987]
Available
Printing records
Moving to output file
*********************************************
Start the extract for customer_id [XXXX-1539]
*********************************************
Start the extract for customer_id [XXXX-4527]
Available
Printing records
Moving to output file
*********************************************
Desired Output:
Start the extract for customer_id [XXXX-2359]
Start the extract for customer_id [XXXX-1539]
I tried:
awk '/Start*/ {p=1;print;next} /$**/ && p {p=0;print} p' test