title: Read string of numbers from text file and add them together
body: <p>I have a .txt called output.txt this is the contents of that file</p>
  
  <p><img src="https://i.stack.imgur.com/brgWH.png" alt="Image of notepad document">
  <br><br>  I want to read the last numbers from each (4th position along)
  <br> and add them all together to get a total. Mainly I want to know how to get the text into some usable variables.</p>
  
  <pre><code>import java.io .*;
  import java.util.*;
  
  public class PrintTotalPointsHeld
  {
  
      private int count;
      private String id;
      private File inFile;
      private Scanner input;
      private String name;
      private File outFile;
      private PrintWriter output;
      private int total;
  
   public PrintTotalPointsHeld (String name, String id, String inFilename, String outFilename) throws Exception, IOException
      {
  }
  
     public void processFiles() throws Exception, IOException
  {
          // Stores every word as a variable so we can do our calculations later
          try(BufferedReader br = new BufferedReader(new FileReader(inFile))) {
              StringBuilder sb = new StringBuilder();
              String line = br.readLine();
  
              while (line != null) {
                  sb.append(line);
                  sb.append(System.lineSeparator());
                  line = br.readLine();
              }
              String points = sb.toString();
  
          }
  
  
          output.println("There are " + count + " accounts that together hold " + total + " points. ");
      }
  }
  </code></pre>
  
  <p>}</p>