How can we used awk/sed/unix command to massage the data. I have a data as below:
/abc/def1.0/Acc101 500 50
/abc/def1.0/Acc101 401 27
/abc/def1.0/Acc101 200 101
/abc/def1.0/Acc201 200 4
/abc/def1.0/Acc301 304 2
/abc/def1.0/Acc401 200 204
For each unique string in the first column $1 how can we merge the value which is separated by value. Column $2 is the code if its 200 it means success other then that its Failed. $3 is the count of the occurrence.
Below are the sample output as we distinct $1 and validate value which has either value 200 or not 200 in $2 and merge/sum the count in $3. Sample as below:
/abc/def1.0/Acc101 101 77
/abc/def1.0/Acc201 4 0
/abc/def1.0/Acc301 0 2
/abc/def1.0/Acc401 204 0
Info for the line: /abc/def1.0/Acc101 101 77
77 = sum of 50+27 from $3 which the value of $2 != 200
Many thanks for the help.