title: Getting unique enteries from the file
body: <p>I am parsing a file with more than 4M lines in it. It is of the form a^b^c^d^...^....
   Now i want all the unique points(only the 1st two entries should be unique) from the file. So what I do is,</p>
  
  <pre><code>String str;
  Set&lt;String&gt; lines = new LinkedHashSet&lt;String&gt;();
  Set&lt;String&gt; set = Collections.synchronizedSet(lines);
  String str1[] = str.split("\\^");
  set.add(str1[0]+"^"+str1[1]);
  </code></pre>
  
  <p>So this gives me the unique 1st and 2nd unique points from the file. However,  I also want the 3rd point(timestamp) i.e str1[2] associated with the above points. The new file should be of the form.</p>
  
  <pre><code>  str1[0]^str1[1]^str1[2] 
  </code></pre>
  
  <p>How do I go about doing this? </p>