Can someone please help me in finding a pattern & then replace 7 characters from the Xth position after the pattern is found.
The file will have N number of records.
There is a pattern [OAF1-REC:} in every record and from there I need to replace the ID which is present at 53 till 59th position. I have marked it bold it in the below two records. Please note the position in which OAF1-REC: appearing in the records is not uniform.
0013259117030009642800 0000440 OAF1-REC:GB00098952920000000000000000290430000000GB00098952922270300096428
0015575117030009642802 0000440 PAS-REC:0000000000000000290430000000GB000989OAF1-REC:GB00098952920000000000000000290430000000GB00098952922270400096428 P
Thanks & your help/guidance will be much appreciated.
The file will have N number of records.
There is a pattern [OAF1-REC:} in every record and from there I need to replace the ID which is present at 53 till 59th position. I have marked it bold it in the below two records. Please note the position in which OAF1-REC: appearing in the records is not uniform.
0013259117030009642800 0000440 OAF1-REC:GB00098952920000000000000000290430000000GB00098952922270300096428
0015575117030009642802 0000440 PAS-REC:0000000000000000290430000000GB000989OAF1-REC:GB00098952920000000000000000290430000000GB00098952922270400096428 P
Thanks & your help/guidance will be much appreciated.