I seem to be getting java.util.InputMismatchException when reading from a file. The file is just an array of numbers
Please advise.
package assignment1;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;
public class Question4 {
public static void main(String[] args) throws FileNotFoundException
{
Scanner inFile =
new Scanner(new FileReader("glassdatatxt.txt"));
Double [][] glassdata = new Double[214][11];
for(int row = 0; row < glassdata.length; row++)
{
for(int col = 1; col < glassdata[row].length; col++)
{
glassdata[row][col] = inFile.nextDouble();
}
}
for(int row = 0; row < glassdata.length; row++)
{
for(int col = 1; col < glassdata[row].length; col++)
{
System.out.print(glassdata[row][col] + " ");
}
System.out.println();
}
}
}