title: Get sublists from list which match predicate
body: <p>I'm very new to Scala, but from what I've read it seems the ideal language to tackle the project I'm working on.</p>
  
  <p>I have a very large CSV file which looks like this:</p>
  
  <pre><code>INDEX, CITY, COST
    7  ,  London, 500
    7  ,  Paris, 200
    11  ,  Rome, 300
    11  ,  New York, 100
    11  ,  Madrid, 7
  </code></pre>
  
  <p>I want to read in the CSV file and produce a list of all the elements with the same index, one index at a time. </p>
  
  <p>From the above example I would like to get a list containing the rows:</p>
  
  <pre><code>7, London, 500
  7, Paris, 200
  </code></pre>
  
  <p>And a second list containing the rows:</p>
  
  <pre><code>11, Rome, 300
  11, New York, 100
  11, Madrid, 7
  </code></pre>
  
  <p>It's pretty easy to read in the CSV file:</p>
  
  <pre><code>val iter = src.getLines().drop(1).map(_.split(",")) //from SO :) 
  </code></pre>
  
  <p>However, I'm struggling to find a clean way of generating my sub-lists. It seems to me that there should be a nice, concise way of achieving this using Scala. I would particularly like the data to be lazy-loaded since there is a lot of it. Could you suggest how I achieve this?</p>
  
  <p>All of the data is in order by index (though the indexes are not sequential), and the CSV file I'm working with does not contain any nested commas or escapes.</p>