Skip to content

Instantly share code, notes, and snippets.

@emanuelvintila
Created June 16, 2020 06:10
Show Gist options
  • Save emanuelvintila/41188210a3d9fb1ab2ae1074a9a2068e to your computer and use it in GitHub Desktop.
Save emanuelvintila/41188210a3d9fb1ab2ae1074a9a2068e to your computer and use it in GitHub Desktop.
#!/usr/bin/env awk -f
{
suma_gr[$2] += $5
count_gr[$2]++
suma_an[$1] += $5
count_an[$1]++
}
END {
for (gr in suma_gr) {
print gr, suma_gr[gr] / count_gr[gr]
}
for (an in suma_an) {
print an, suma_an[an] / count_an[an]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment