title: PIG parsing string inputs
body: <p>I have two files, </p>
  
  <p>one is titles.csv and has a movie ID and title with this format:</p>
  
  <pre><code>999: Title
  734: Another_title
  </code></pre>
  
  <p>the other is a list of user IDs who link to the movie</p>
  
  <p>categoryID: user1_id, ....</p>
  
  <pre><code>222: 120
  227: 414 551
  249: 555 
  </code></pre>
  
  <p>Of different sizes (minimum is one user per genre category)</p>
  
  <p>The goal is to first <strong>parse the strings so that they are each split into two (for both files), everything before the ':' and everything after.</strong></p>
  
  <p>I have tried doing this</p>
  
  <pre><code>movies = LOAD .... USING PigStorage('\n') AS (line: chararray)
  users = LOAD .... USING PigStorage('\n') AS (line: chararray)
  
  -- parse 'users'/outlinks, make a list and count fields
  tokenized = FOREACH users GENERATE FLATTEN(TOKENIZE(line, ':')) AS parameter;
  filtered = FILTER tokenized BY INDEXOF(parameter, ' ') != -1;
  result = FOREACH filtered GENERATE SUBSTRING(parameter, 2, (int)SIZE(parameter)) AS number;
  </code></pre>
  
  <p>But this is where I got stuck/confused. Thoughts?</p>
  
  <p>I'm also supposed to output the top 10 entries who have the most user IDs in the second part of the string. </p>