Hello,
I have two files, consider that as file1 and file2. Here file1 is the master file.
file1 will contain data like

GS*RA*071000013*102562451P*091130*0520*334052023*X *003050
ST*820*334052023
BPR*C*509.77*C*ACH*CTX*01*071000013*DA*5529085*900 000XXXX**01*071000013*DA*5529085*091130
NTE*ZZZ*80217E
REF*PY*A97983
REF*TN*081000602100305*TRACE NUMBER FROM THE ACH PAYMENT
DTM*020*091127
N1*PR*CIS INFO. VEND.*ZZ*PAYER FROM ACH
ENT*1*AG*94*CASS
N1*BT* MOBILITY
RMR*IV*206Z130004706B**214.93
NTE*OTH*ACCT#J-520-294-1749 877M
DTM*003*091101
RMR*IV*503Z130027168B**294.84
NTE*OTH*ACCT#J-644-294-1659 877M
DTM*003*091018
RMR*IV*456Z130027123C**294.84
SE*000014*334052023
GE*1*334052023

file2 will contain data like
RMR*IV*206Z130004706B**200.93
NTE*OTH*ACCT#J-520-294-1749 877M
DTM*003*091101

Here in file2 a account number will be found in RMR line as highlighted in bole. The same account number will be found in file1 too. And there is a change in the amt as that is also highlighted in bold.I have to write a script or awk so that the file2 content is replace in file1, so the file1 after replacing should look like

GS*RA*071000013*102562451P*091130*0520*334052023*X *003050
ST*820*334052023
BPR*C*509.77*C*ACH*CTX*01*071000013*DA*5529085*900 000XXXX**01*071000013*DA*5529085*091130
NTE*ZZZ*80217E
REF*PY*A97983
REF*TN*081000602100305*TRACE NUMBER FROM THE ACH PAYMENT
DTM*020*091127
N1*PR*CIS INFO. VEND.*ZZ*PAYER FROM ACH
ENT*1*AG*94*CASS
N1*BT*MOBILITY
RMR*IV*206Z130004706B**200.93
NTE*OTH*ACCT#J-520-294-1749 877M
DTM*003*091101
RMR*IV*503Z130027168B**294.84
NTE*OTH*ACCT#J-644-294-1659 877M
DTM*003*091018
RMR*IV*456Z130027123C**294.84
SE*000014*334052023
GE*1*334052023

the difference between the original file1 and the required output is the also highlighed in bold.

So can you help me in replacing the lines in file2 to file1 by finding the correct account number from RMR record.

Thanks.