How can I make this stop exceeding the actual amount of values preventing the crash?
    String[][] firstLine = new String[8][10];
    Scanner input = new Scanner(new File("lab1.dat"));
    String temp2 = " ";
    for(int i = 0; i < firstLine.length; i++){
        for(int j = 0; j < firstLine[i].length; j++){
            firstLine[i][j]  = input.nextLine();
            System.out.println(firstLine[i][j] );
1000 1011 1006 1211 1854 1799 10 34 18 96 45
10 R W X O A N O N N N X
34 N A W X X R N O N R N
18 W N N A X N N N O N N
96 W W W R R X N R N O W
45 R W N O N N N N X R O
10 1006 
34 1000
34 34
96 1211
96 1854
45 18
34 1211
-1 -1 
     
     
     
    