Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.24 KB | None | 0 0
  1. #!/usr/bin/awk -f
  2. BEGIN {
  3.     FS="\t"
  4. }
  5.  
  6. /[0-9]+a/ {
  7.     n_righe = NR
  8.     punteggi[++riga]=$3
  9. }
  10.  
  11. /^[0-9]+[^0-9a]/ {
  12.     classifica[$2]+=punteggi[$1]
  13. }
  14.  
  15. END {
  16.     print "Classifica\n"
  17.     for (player in classifica)
  18.     print classifica[player], player
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement