title: Suitable Java data structure for parsing large data file
body: <p>I have a rather large text file (~4m lines) I'd like to parse and I'm looking for advice about a suitable data structure in which to store the data. The file contains lines like the following:</p>
  
  <pre><code>Date        Time    Value
  2011-11-30  09:00   10
  2011-11-30  09:15   5
  2011-12-01  12:42   14
  2011-12-01  19:58   19
  2011-12-01  02:03   12
  </code></pre>
  
  <p>I want to group the lines by date so my initial thought was to use a <code>TreeMap&lt;String, List&lt;String&gt;&gt;</code> to map the date to the rest of the line but is a <code>TreeMap</code> of <code>List</code>s a ridiculous thing to do? I suppose I could replace the String key with a date object (to eliminate so many string comparisons) but it's the <code>List</code> as a value that I'm worried might be unsuitable.</p>
  
  <p>I'm using a <code>TreeMap</code> because I want to iterate the keys in date order.</p>