title: Extracting Tuple from Bag in PIG
body: <p>FILE COntent (test.txt):</p>
  
  <pre><code>Some    specific    column      value: x192.168.1.2     blah       blah
  Some    specific    row        value: y192.168.1.3      blah       blah
  Some    specific    field      value: z192.168.1.4     blah      blah
  </code></pre>
  
  <p>PIG QUERY:</p>
  
  <pre><code>A = LOAD 'test.txt' USING PigStorage('\t') AS (data1: chararray , data2: chararray , data3: chararray, data4: chararray , data5: chararray , data6: chararray);
  
  B = foreach A generate data3, data4;
  
  C = filter B by data3 matches 'row';
  
  D = foreach C generate data4;
  
  E = foreach D generate TOKENIZE(data4);
  </code></pre>
  
  <p>Output :</p>
  
  <pre><code>((value:), (y192.168.1.3))
  </code></pre>
  
  <p>Now i want to extract specific tuple in this output bag, say second tuple (y192.168.1.3).
  After this i want to extract the IP address. I am trying to do with UDFs but got stuck.</p>