Comment stocker le tableau à partir d'un fichier .dat ?
Bonsoir,
j'ai pas trouvé comment stoker un tableau a partir d'un fichier.dat , j'ai fait une recherche sur google mais j'ai pas trouvé la solution
ou bien j'ai pas compris :-) .
quelqu'un (e) peut m'aider s'il vous plait.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| String text = "C:\\Desktop\\pmiercode\\Pier\\geni.dat";
FileReader fr;
fr = new FileReader(text);
br = new BufferedReader(fr);
String line = br.readLine();
StringTokenizer st = new StringTokenizer(line);
String xLabel = st.nextToken();
String yLabel = st.nextToken();
while (true) {
line = br.readLine();
if (line == null) {
break;
}
st = new StringTokenizer(line);
String xValue = st.nextToken();
String yValue = "";
yValue = st.nextToken();
float x = Float.parseFloat(xValue);
float y = Float.parseFloat(yValue);
//ici je veux stoker la valeur x dans un tableu mais je sais pas comment faire
} |