title: I want to take file text lines and put into an array to later compare the lines for duplicates
body: <p>So my knowledge of java is very "green". What I am wanting to do is just read a file line by line, then compare a line to every other line to look for duplicates. Then repeat with the next line skipping the first line i compared to. Lastly I am going to have to compare specific lines from the text file and they DO need to match.</p>
  
  <p>Here's what I have so far.</p>
  
  <pre><code>import java.io.*; 
  import java.util.*;
  import java.io.IOException;
  public class PracticeFileStuff {
      public static void main(String[] args){
      try{
          BufferedReader br = new BufferedReader(new FileReader("filepath"));
          ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
          String line;
      while ((line = br.readLine()) !=null){
          list.add(line);
      }
          br.close();
          System.out.print(list);
      }
      catch (IOException e){
          e.printStackTrace();
      }
  
  
  }
  }
  </code></pre>
  
  <p>I guess where I want to start at is assigning the lines to the arraylist so that I can do something like below. Next I was thinking for comparing the specific lines I think I'm making that part way more complicated than it is. What I need is when I check a specific line to run a different loop that actually looks for a certain line to match correctly.</p>
  
  <p>Psuedo Code</p>
  
  <pre><code>    for(int i = 0; i &lt;= numberLines; numberLines++){
  
  if (!list[i].equals(list[numberLines])) {
      //keep checking
  }else {
  do{
  
  }while (i = list[4] &amp;&amp; numberLines = list[8] &amp;&amp; list[4] == list[8]);{
      //keep checking if another line matches
  }
  }
  }
  </code></pre>
  
  <p>I also have to compare other lines besides line 4 but I'll get to that later. Maybe this is not the method I want.</p>
  
  <p>My question is how do I assign my arraylist strings integer vaules or how to compare entire strings to each other.</p>
  
  <p>I know this is alot but I'm ready to learn!</p>