title: Reading a text file & adding the content to an ArrayList
body: <p>I am learning about all of the different ways to take input from a text file and read through the content. I am struggling to use a try - catch block (with resources), and reading in the file name.</p>
  
  <p>Below is what I have written for this part so far:-</p>
  
  <pre><code>public static void main(String[] args) 
  {
  
      ArrayList&lt;StationRecord&gt; data = new ArrayList&lt;&gt;();
      String stationName = null;
  
      Scanner scan = new Scanner(System.in);
      System.out.println("What is the filename?");
      String input = scan.nextLine();
      File file = new File(input);
  
      try(BufferedReader in = new BufferedReader(new FileReader(file))){
  
        while(scan.hasNext()){
  
         stationName = scan.nextLine();
         int yearMonthDay = scan.nextInt();
         int max = scan.nextInt();
         int min = scan.nextInt();
         int avg = scan.nextInt();
         double dif = scan.nextDouble();
  
         StationRecord sr = new StationRecord(yearMonthDay, max, min, avg, dif);
         data.add(sr);
        }
  
      }
      catch(IOException e)
      {
          e.printStackTrace();
      }
      catch(Exception e)
      {
          e.printStackTrace();
  
      }
  }
  </code></pre>
  
  <p>I am trying to do this for not only one file, but two of them. Regardless, here is a sample of input:-</p>
  
  <p>Console: What is the filename?</p>
  
  <pre><code>TempData2018a.txt
  </code></pre>
  
  <p>After this is entered, I am trying to go through the data in the text file and add it to the <strong>ArrayList</strong> of type <em>StationRecord</em> (my other class).</p>
  
  <p>Any suggestions and guidance would be much appreciated! Also any input on how you might do this with 2 files would be awesome!. </p>
  
  <p>Edit: .txt file data example</p>
  
  <pre><code>PITTSBURGH ALLEGHENY CO AIRPORT PA
  20180101 11 2 7 -22.614762
  20180102 12 5 9 -20.514762
  20180103 23 2 13 -16.414762
  </code></pre>
  
  <p>I am trying to store that whole first line in a variable called stationName. Then Im trying to store the next int, int, int, int double in an <strong>ArrayList</strong> of <em>StationRecord</em> type.</p>