Hey i need help i need to read in a file (the delimiter below) n store it in an araay whilst changing a string from the end of the file into the array by changing it into an int .
Any Help this is what i have up to now.
the problem is that is saying that the second scanner is not working.
also im not sure if it is storing the changed strings
{ File dataFile = new File (fileName); Scanner scanner = new Scanner(dataFile); //System.out.println(scanner.nextLine()); cohortName = scanner.nextLine(); int responces = scanner.nextInt(); scanner.nextLine(); //int numberOfStudentResponses=scanner.nextInt(); //System.out.println("Number of Student Responces " + responces); testMarks = new int [responces][10]; int gem = 0; for(int add=0; add<responces; add++) { Scanner scanner2 = new Scanner(scanner.nextLine()); scanner2.useDelimiter("[ ]*(,)[ ]*"); for (int columns =0; columns<10; columns ++){ for(int i=0; i<4; i++) { switch(scanner2.next()) { case "excellent": gem= gem + 5; break; case "very good": gem= gem + 4; break; case "good": gem= gem + 3; break; case "average": gem= gem + 2; break; case "poor": gem= gem + 1; break; } testMarks[add][columns+gem] = scanner2.nextInt(); //System.out.println(); } //for the third for } // for the second for scanner2.close(); scanner.close(); }//for the first } // to end