Hi,
I have below as i/p file:
5ABC 36488989 K 000010000ASB BYTRES
5PQR 45757754 K 000200005KPC HGTRET
5ABC 36488989 K 000045000ASB HGTRET
5GTH 36488989 K 000200200ASB BYTRES
5FTU 45757754 K 000003002KPC HGTRET
5FTU 45757754 K 007000001KPC BYTRES
5GTH 36488989 K 062000100ASB HGTRET
5PQR 45757754 K 000500000KPC HGTRET
My o/p should be
5ABC 36488989 K 000055000ASB
5GTH 36488989 K 062200300ASB
5FTU 45757754 K 007003003KPC
5PQR 45757754 K 000700005KPC
Field in green - Key 1
Field in Red - key 2
For all the records having unique combination of key1 and key2, I need to add values in green.
For example I have below two rows for the combination of 36488989 and ABC. In the o/p I need
5ABC 36488989 K sum(000010000 + 000045000)
Problem for me here is two keys to get the duplicate rows.
I am trying to use awk to get the solution.