Advertisement
cd62131

Separate Teams

Nov 11th, 2013
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.23 KB | None | 0 0
  1. #!/usr/bin/awk -f
  2. { if ($2 < 30) { team[$1]["active"] += $2 + 60 }
  3.   else { team[$1]["active"] += $2 }
  4.   team[$1]["result"] += $3
  5. }
  6. END {
  7.   for (i in team) {
  8.     printf "%d %d %d\n", i, team[i]["active"], team[i]["result"]
  9.   }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement