How to build a relationship between consecutive records in PIG?
<p>I have a data file like:</p>

<pre><code>Top executives  11-1000 Summary \n
Chief executives    11-1011 Line item \n
General and operations managers 11-1021 Line item \n
Legislators 11-1031 Line item \n
</code></pre>

<p>I want to read this data file using PIG and achieve an output covering the  summary and the line items in a single row like:</p>

<pre><code>Top executives Chief executives 11-1011 \n
Top executives General and operations managers 11-1021 \n
Top executives Legislators  11-1031 \n
</code></pre>

<p>Can somebody help me with some ideas for this ?</p>