i have file which is in this format. 50 xxx/ 70 aaa/ 90 ccc/
the program saves the file to default directory, the same one i think its trying to read from. but it just doesnt scan anything... what is wrong please? im not good at programing sorry
i would like it to read the 50 to "prior" xxx to "text" and then use those two things in aPf.insert(prior, text).
File file = new File("poznamky.txt");
Scanner scanner = null;
int prior;
String text;
try {
scanner = new Scanner(file);
scanner.useDelimiter("/");
while (scanner.hasNext()) {
prior = scanner.nextInt();
text = scanner.next();
aPf.insert(prior, text);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}