Witam potrzebuje zczytac dane z pliku ktory jest w takim formacie:
sdasda
2
80
90
dsadds
0
430
sadas
2
5656
6556
26565
Zrobilem to w taki sposob:
String town = fileIn.next();
int name = fileIn.nextInt();
int name1 = fileIn.nextInt();
int name3 = fileIn.nextInt();
fileIn.hasNext();
String town1 = fileIn.next();
int Change1 = fileIn.nextInt();
int Time3 = fileIn.nextInt();
fileIn.hasNext();
String town2 = fileIn.next();
int name8 = fileIn.nextInt();
int name7 = fileIn.nextInt();
int Time565 = fileIn.nextInt();
int Time67 = fileIn.nextInt();
Program dziala jednak ze jezeli chcial bym zmienic dane w pliku np dodac jakies nowe dane lub zmodyfikowac stare zapewne musial bym to edytowac pod celowy dokument. Jak moge to zczytac w bardziej elastyczny sposob? Dane ktore zmieram sa pozniej uzywane w dzialaniach matematycznych i w if statmentach.