I am trying to read a txt file that contains strings with integers. I would like to be able to get just the integers from this file and add the value each to create a total.
You have done all the work and stuck with simple addition. Declare a variable total and add integers(values) to it. In the code block, if(scan.hasNextInt()) add the following statement :
total += scan.nextInt().
Do not forget to declare the variable before hand.