aggregate and count to tab delim file