Considering below file:
0,2,,,10
0,2,,,15
0,1,,,984
0,2,,,9
1,14,,,5
Using awk
, I need to calculate the total value in $5
per each $2
.
The desired output would look like below:
2,34
1,984
14,5
awktext processing
Considering below file:
0,2,,,10
0,2,,,15
0,1,,,984
0,2,,,9
1,14,,,5
Using awk
, I need to calculate the total value in $5
per each $2
.
The desired output would look like below:
2,34
1,984
14,5
Best Answer
Try:
A note that array traversal in POSIX awk is unspecified order.