Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/awk -f
- BEGIN {
- FS = ":"
- mediamax = 0
- }
- {
- somma = 0
- mediariga = 0
- for(i=2;i<=NF;i++) {
- somma+=$i
- }
- conta = NF-1; # tiene conto del numero di campi meno quello del nome
- # posso stampare la media anche nella riga corrente
- mediariga = somma/conta;
- printf("%s: %f\n",$1,mediariga);
- if (mediariga > mediamax) mediamax = mediariga;
- }
- END {
- printf("\nMAX: %f\n",mediamax);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement