title: Counting Instance number for Categories in Pig
body: <p>I have a sensor output data file as :</p>
  
  <pre><code>category   &lt;tab&gt; instance &lt;space&gt; instance2 &lt;space&gt; ... instanceN
  category2  &lt;tab&gt; instanceX &lt;space&gt; instanceY &lt;space&gt; ... instanceZ
  </code></pre>
  
  <p>Now for every instance, I need to count how many categories have this particular instance.
  I am new to pig, can anyone suggest, how should I go about this problem?</p>