get a count of unique values in the first column of file (foo is the file name):

cat foo  | awk -F \\, '{print $1}' | sort -u | wc  -l

Replace the comma with whatever your field separator is. Replace $1 with whatever column number you’re looking for. Counts unique values - get rid of sort -u to get everything.