For my java class in college, I need to read a text file that holds the scores of a golf game and add them together to reach a total. I can scan the first column of the file fine, but I cannot figure out how to read the integers in the second, third, etc. column(s).
Here is the pertinent Method:
public static int Total(int passed, String fileName) throws IOException {
int total = 0;
Scanner fileScan = new Scanner(new File(fileName));
for (int line = 1; line <= 18; line++) {
for(int col = passed; col == passed; col++) {
total += fileScan.nextInt();
}
}
return total;
} //End of Total Method