title: Aggregate CSV data with group by in Java
body: <p>I need to aggregate CSV data with <code>group by</code> in Java.</p>
  
  <p>My csv file looks like this:</p>
  
  <pre><code>Numero, NumeroWsn, NoeudAdress, PacketRece, NoeudsRece, Hello
  1436136640477044,wsn430-8,NA:b27b,Packet recevied from,RX: b0b4, Hello #33
  1436136640477257,wsn430-8,NA:b27b,Packet recevied from,RX: b986, Hello #33
  1436136640477415,wsn430-8,NA:b27b,Packet recevied from,RX: bc2d, Hello #33
  1436136640477566,wsn430-8,NA:b27b,Packet recevied from,RX: b36b, Hello #34
  1436136640477716,wsn430-8,NA:b27b,Packet recevied from,RX: bcb6, Hello #35
  1436136640477995,wsn430-9,NA:bc2d,Packet recevied from,RX: 1f9e, Hello #33
  1436136640478162,wsn430-9,NA:bc2d,Packet recevied from,RX: be29, Hello #33
  1436136640478313,wsn430-9,NA:bc2d,Packet recevied from,RX: b61a, Hello #32
  1436136640478462,wsn430-9,NA:bc2d,Packet recevied from,RX: c735, Hello #32
  1436136640478612,wsn430-9,NA:bc2d,Packet recevied from,RX: bb0a, Hello #32
  1436136640478760,wsn430-9,NA:bc2d,Packet recevied from,RX: b6bc, Hello #33
  1436136640477044,wsn430-8,NA:b27b,Packet recevied from,RX: b0b1, Hello #42
  1436136640477257,wsn430-8,NA:b27b,Packet recevied from,RX: b984, Hello #44
  </code></pre>
  
  <p>Is there a way to aggregate these data by grouping by <code>NoeudAdress</code> and show <code>NoeudsRece</code> counters as column like shown below using Java?</p>
  
  <pre><code>NoeudsAdresse,NumberOfNoeudsRece
  
  b27b ,7
  bc2d ,6
  </code></pre>
  
  <p>I thought of loading CSV file to a List using OpenCSV, but is it efficient for a csv file with millions of rows? </p>