Utils: latex table genaration script for bt-unified-tracker papar
[p2p-testing-infrastructure.git] / Utils / avg2_scale2
1 #!/usr/bin/awk -f
2 # Calculates the average value of 2 columns. Lines with the first column 0 are not taken into account.
3
4 BEGIN   {
5         n_items = 0
6         sum1 = 0.0
7         sum2 = 0.0
8         FS = "[ \t]+"
9 }
10
11 /^[0-9]+/ {
12         if($1 != 0)
13         {
14                 n_items++
15                 sum1 += $1
16                 sum2 += $2
17         }
18 }
19
20 END     {
21         printf "%.2f %.2f\n", sum1 / n_items, sum2 / n_items
22 }