iamjon.smith
- 117
- 3
even switching to the proper slash "\t" as follows:
I still get the error writing to file.
I am still missing something.
Code:
scanner = new Scanner(new File("population.txt"));
scanner.useDelimiter("\t");
while (scanner.hasNextLine())
{ //Checks if there's any more lines
city = scanner.next(); // reads to first space in line, sets the variable
state = scanner.next(); // reads to second space in line, sets the variable
population = scanner.nextInt(); // reads to the next space in line, sets variable
//...more code
I still get the error writing to file.
I am still missing something.