|
Finding the most common entry in a column
Hi,
I have a file with 3 columns in it that are comma separated and it has about 5000 lines. What I want to do is find the most common value in column 3 using awk or a shell script or whatever works! I'm totally stuck on how to do this.
e.g.
value1,value2,bob
value1,value2,bob
value1,value2,bob
value1,value2,dave
value1,value2,james
Clearly in the above example the most popular value in column3 is "bob", but how would I write a script to work this out?
Many thanks
|