title: How to count number of unique values of a field in a tab-delimited text file?
body: <p>I have a text file with a large amount of data which is tab delimited. I want to have a look at the data such that I can see the unique values in a column. For example,</p>
  <pre><code>Red     Ball 1 Sold
  Blue    Bat  5 OnSale
  ............... 
  </code></pre>
  <p>So, its like the first column has colors, so I want to know how many different unique values are there in that column and I want to be able to do that for each column.</p>
  <p>I need to do this in a Linux command line, so probably using some bash script, sed, awk or something.</p>
  <p>What if I wanted a count of these unique values as well?</p>
  <p>Update: I guess I didn't put the second part clearly enough. What I wanted to do is to have a count of &quot;each&quot; of these unique values not know how many unique values are there. For instance, in the first column I want to know how many Red, Blue, Green etc coloured objects are there.</p>