Very nice, thanks. I'll hang on to that little script, might be very handy.
Took me a bit of time to get the percentages working though, ended up having to alter the line to
echo "scale=2; $LINE/$TOTAL * 100" | bc
otherwise every division was returning zero.