I have a text file. I need to search for two strings and replace the string for values from another line. I am attaching the text file.
The requirement is like below:
For every :61: line it will search for NOREF or NONREF string,
if anyone of these exist, this string (NOREF/NONREF) will be replaced with the string in :86: line (the only :86: line that follows :61: line) OUR REF and YOUR REF which is in bold and italic in the below example. like below NOREF will be replaced by 031CHO090928100268/9000022276
Example:
:61:090925C146,00NTRFNOREF
:86:051?00UEBERWEISUNG?109696/405?20OUR REF: 031CHO090928100268?2
1YOUR REF: 9000022276?22DEUTSCHE BANK AG FILIALE WI?23ESBADEN W
ILHELMSTR. 20-22 /?24DEUTSCHE BANK AG ZENTRALE F?25RANKFURT DB-
CHEQUE (EUROPE)?26M*PO FAV Y/DEUTDEFF510?27ZGR: RETURN OF A CHE
QUE 111
Please help me in doing this. The text file to be processed has been attached.
Thanks in advance.
Regards,
Rasmi