awk
awk '
{
task[$3,$1] += $2
count[$3,$1] += 1
}
END {
for (t in task) {
split(t, tHour, "4");
print tHour[1] " " tHour[2] " " count[t] " " task[t] / count[t]
}
}
' yourFile
Resultado
Tarefa, hora, número de ocorrência, média de tempo de resposta
searchFileStatus 19 1 1708
searchLead 19 1 1439
getLead 15 1 999
jointCall 15 1 999
jointCall 16 5 1029.8
updateLead 19 1 1832
createLead 15 1 999
createLead 16 1 1019
getLTSUserDetails 17 1 189
createLead 17 2 1019
searchLead 15 1 999
Tentativa anterior:
awk
awk '
{
task[$3] += $2
count[$3] += 1
}
END {
for (t in task) {
print t " " count[t] " " task[t] / count[t]
}
}
' yourFile
Resultado
Tarefa, Número da ocorrência, Média do tempo de resposta
updateLead 1 1832
jointCall 6 1024.67
getLead 1 999
getLTSUserDetails 1 189
createLead 4 1014
searchLead 2 1219
searchFileStatus 1 1708