I have an xml file which contains below
<SummaryRecordMapping>
<eName>Licensed Original MC TPE EXCESSIVE AUTH</eName>
<jobs>
<job>
<SummaryRecordMapping>
<eName>Licensed Reversal MC TPE EXCESSIVE AUTH</eName>
<jobs>
<job>
I want output like below
<SummaryRecordMapping>
<eName>Licensed Original MC This is New Deep</eName>
<jobs>
<job>
<SummaryRecordMapping>
<eName>Licensed Reversal MC This is New Deep</eName>
<jobs>
<job>
<SummaryRecordMapping>
<eName>Licensed Original MC This is Mayurika</eName>
<jobs>
<job>
<SummaryRecordMapping>
<eName>Licensed Reversal MC This is Mayurika</eName>
<jobs>
<job>
CODE
#!/bin/bash
while read whole_line ;
do
name=`echo "$whole_line" | awk '{$1=""; print}'`
LO="<eName>Licensed Original MC ${name}</eName>"
awk -v diff="$LO" '{ if(NR==2) { print diff}
else {print $0} } ' southBalanceRecon.xml >>LO.xml
LR="<eName>Licensed Reversal MC ${name}</eName>"
awk -v diff="$LR" '{ if(NR==14) { print diff}
else {print $0} } ' LO.xml >> LR.xml
done < file.txt
FILE.txt
C71 This is New Deep
C72 This is Mayurika
When i am trying to run my code i am not getting the probable output which i mentioned above. Can anyone tell me what is wrong with my code?