#!/bin/sh

# From: ralf@ark.btbg.sub.de (Ralf W. Stephan)
# Additions: dedos4@win.tue.nl
# Subject: Script
# Date: Sat, 12 Feb 1994 12:01:41 GMT
#
# While I'm at it, here is another little script for the stat freaks:
# (Change '/home/svin04d/dedos4/bin/nethackdir/record' to your convenience)
#
# The output looks like:
#
# S:   15  116077 1741160
# E:   11  103498 1138475
# V:   15   23642  354629
# B:   12   18708  224490
# T:    4   12931   51723
# H:    5   10579   52893
# P:   11   10298  113273
# K:    3    3827   11482
# A:    4    3616   14462
# C:    3    3556   10668
# W:   12    3403   40837
# R:    4    2668   10672

cat /home/svin04d/dedos4/bin/nethackdir/${1:-record} | awk '

BEGIN {ORS=": "}

!/quit/	{	c = substr($9,1,1)
		sum[c] += $8
		num[c]++
	}

END	{	for (c in num)
		{ print c
		  printf "%4d %7.0f %7.0f\n", num[c], sum[c]/num[c], sum[c]
		}
	}

' | sort -nr +2

