title: compare 2 arrays and remove duplicates ? Java
body: <p>so I am trying to compare 2 huge lists of text in java . The texts might look like this :</p>
  
  <p>list1 : value 1 , value 2 , value 3 ...
  list2 : value 1604 , value 7000 , value 1 ... </p>
  
  <p>The point is I like to compare from list 1 to each line in list 2 ( each value is in own line ) and remove duplicates from list 2 write a ARRAY 3 to file . this is what I got :</p>
  
  <p>EDIT :</p>
  
  <pre><code>    File haveFile = new File("Combine Without Dups.txt");
      BufferedReader br = null;
      br = new BufferedReader(new FileReader(haveFile));
      String line ;
      String list = null ;
  
      while ((line = br.readLine()) != null) {
  
      list = line ;
  
      }
  
      File compareFile = new File("database.txt");
      BufferedReader br2 = null;
      br2 = new BufferedReader(new FileReader(compareFile));
      String line2 ;
      String list2 = null ;
  
      while ((line2 = br2.readLine()) != null) {
  
      list2 = line2 ;
  
      list2.removeAll(list);
  </code></pre>