Thanks Vgersh , I have correct the code as per your advise.
I am getting expected output if i use awk operation twice i.e. by storing the output before array operation
and on new file if i use array operation I am getting correct output.
But as I was using awk twice , I thought of combining it. Do we something like pipe in awk ?
So it will be like first get this file..
Code:
PL0000101937~B~L~100000~DS1110~FMT
PLKGHM000017~B~L~85000~KGHM~SHS
PLKGHM000017~L~L~-35000~KGHM~SHS
PLKGHM000017~L~L~-40000~KGHM~SHS
PLPKO0000016~B~L~310000~PKO S.A.~SHS
PLPKO0000016~L~L~-290000~PKO S.A.~SHS
and then perform array operation of calculation on this , But My query is can't this be done using one awk operation.