title: Create for element of a CSV a List in Java
body: <p>I have a question regarding csv and java. 
  I have a csv file with a lot of data. There are for example three different ids, and per id around 5k data points. </p>
  
  <p>The csv is like following:
  ID, Data1(String), Data2(Long), Data3(Float), Data4(Float), Data5(Float)</p>
  
  <p>I read the csv an store every column to another linked list, so that for ever linked list the index i is one row.</p>
  
  <p>What I want to do is to have a per ID a list of the data.</p>
  
  <p>I have done it so far like this:</p>
  
  <pre><code>LinkedList&lt;String&gt; new_id = new LinkedList();
  LinkedList&lt;String&gt; new_data1 = new LinkedList();
  LinkedList&lt;String&gt; new_data2 = new LinkedList();
  ....
  ....
  
  for(int i = 0; i &lt; id.size(); i++){
      if(id.get(i).equals(String theidiwant){
          new_id.add(id.get(i));
          new_data1.add(data1.get(i));
          ....
          ....
  }
  </code></pre>
  
  <p>So my question would be whether there is a simple solution to create for each id a list of those data.</p>
  
  <p>I hope you understand what I am trying to ask. 
  Sorry for that complicated description.</p>
  
  <p>Cheers!</p>