Hi,
This can help you,
cat file1
tony,1,x
tony,1,x
tony,2,x
tony,2,x
tony,3,x
tony,4,x
tony,5,x
adam,1,y
cat file1 | sort | uniq -c | awk '{print $2"\t""COUNT"$1}'
adam,1,y COUNT1
tony,1,x COUNT2
tony,2,x COUNT2
tony,3,x COUNT1
tony,4,x COUNT1
tony,5,x COUNT1
Then second step
cat file1 | sort | uniq -c | awk '{print $2"\t""COUNT"$1}' | awk '{print $2}' | sort | uniq
COUNT1
COUNT2
Next step so search COUNT2 parameters
cat file1 | sort | uniq -c | awk '{print $2"\t""COUNT"$1}' | grep "COUNT2"
tony,1,x COUNT2
tony,2,x COUNT2
Unix is life. Always try to find easy way.
Regards,
Goksel Yangin
Computer Engineer