title: Read first 5 lines from file and then the rest
body: <p>Disclaimer: This is homework, so I'm working under some restrictions.</p>
  
  <p>I need to read the first 5 lines of a file and use these strings to change labels and buttons, and then the rest of the file is saved as an arraylist. </p>
  
  <p>The file looks like this:  </p>
  
  <pre><code>Name  
  Label1  
  Label2  
  Button1  
  Button2  
  Button3  
  word0,word0  
  word1,word1  
  etc  
  </code></pre>
  
  <p>I already have the ability to read the wordpairs in (word0,word0 etc) with the following code (the first 5 lines are additions, so it might not work now):</p>
  
  <pre><code>public static ArrayList loadFile(String filename) {
      ArrayList&lt;Wordpair&gt; temp = new ArrayList&lt;&gt;();
      try {
          FileInputStream fis;
          fis = new FileInputStream(filename);
          //Scanner to read individual lines from a file
          Scanner scan = new Scanner(fis);
          while (scan.hasNext()) {
              String line = scan.nextLine();
              //Scanner to read individual items from a string 
              Scanner lineScan = new Scanner(line);
              lineScan.useDelimiter(",");
              String question = lineScan.next();
              String answer = lineScan.next();
              //Create the new Wordpair
              Wordpair wp = new Wordpair(question, answer);
              //Add the new wordpair to the list
              temp.add(wp);
          }
          scan.close();
      } catch (FileNotFoundException ex) {
          Logger.getLogger(IO.class.getName()).log(Level.SEVERE, null, ex);
      }
      return temp;
  }
  </code></pre>
  
  <p>My idea is to save the first 5 lines of the file as a separate object which only contains the information found in the file, but I have no idea how to do so. 
  My initial thought was to create a new method which only read in the first 5 lines and then returned an object like the code above does with wordpairs, but I haven't been able to get anything working. And then I guess I'd need to make the existing code skip the beginning.</p>
  
  <p>As you can see I'm pretty confused here, so if anyone could point me in the right direction I would be very grateful!</p>