have this text file:
name, age joe,42 jim,20 bob,15 mike,24 mike,15 mike,54 bob,21
Trying to get this (count):
joe 1 jim 1
A strictly awk solution...
BEGIN { FS = "," } { ++x[$1] } END { for(i in x) print i, x[i] }
If name, age is really in the file, you could adjust the awk program to ignore it...
name, age
BEGIN { FS = "," } /[0-9]/ { ++x[$1] } END { for(i in x) print i, x[i] }