I have this input file:

```
6
8
ABBEJCDD
ULSCALAR
FUGLVRUT
STOUASTO
STOALGOT
LALGOSLU
8
SCALA
JAVA
ALGOS
ALGORITHM
SLUG
SLUR
GOES
TURTLE

```

Currently, what I have it doing is reading the first two items, which are ints, and adding them to an ArrayList. I then want to read only the next 6 lines up to and not including the "8" and add them to an array.

How would I modify my code to do so?

```
    Scanner fileScanner = null;
    File inFile = new File("input.dat");

    ArrayList<Integer> rc = new ArrayList<Integer>();

    try {
        fileScanner = new Scanner(inFile);
        System.out.println("The input has been loaded successfully.");

        while (fileScanner.hasNextInt()) {
            int tempRowsCols = fileScanner.nextInt();
            rc.add(tempRowsCols);
        } // end while

        while (fileScanner.hasNext()) {
            System.out.print(fileScanner.next());
        }
    } // end try

    catch (Exception e) {
        System.out.println("Did not work.");
    }

```