I have a file with contents as follows
Record 1: Rejected - Error on table "DWO"."P2G_CUST_EVENTS".
ORA-00001: unique constraint (DWO.CUST_EVENTS_PK) violated
Record 5: Rejected - Error on table "DWO"."P2G_CUST_EVENTS".
ORA-00001: unique constraint (DWO.CUST_EVENTS_PK) violated
Record 6: Rejected - Error on table "DWO"."P2G_CUST_EVENTS".
ORA-00256: integrity constraint (DWO.CUST_EVENTS_PK) violated
Record 7: Rejected - Error on table "DWO"."P2G_CUST_EVENTS".
ORA-00001: unique constraint (DWO.CUST_EVENTS_PK) violated
Now I need to find the record numbers against the rows having unique constraints. The data is present in 2 seperate lines, where the record number is present in the frist line and the Oracle Error in the subsequent line
I need to get the values
as follows in a file
1
5
7
because these are the record numbers of the rows having unique constraint errors.
I would like to know how to do it in shell scripting.