Index: lutinmatrix/src/java/org/codelutin/math/matrix/AbstractMatrixND.java diff -u lutinmatrix/src/java/org/codelutin/math/matrix/AbstractMatrixND.java:1.12 lutinmatrix/src/java/org/codelutin/math/matrix/AbstractMatrixND.java:1.13 --- lutinmatrix/src/java/org/codelutin/math/matrix/AbstractMatrixND.java:1.12 Thu Jun 1 17:38:56 2006 +++ lutinmatrix/src/java/org/codelutin/math/matrix/AbstractMatrixND.java Tue Jun 6 07:32:22 2006 @@ -23,9 +23,9 @@ * Created: 29 oct. 2004 * * @author Benjamin Poussin - * @version $Revision: 1.12 $ + * @version $Revision: 1.13 $ * - * Mise a jour: $Date: 2006/06/01 17:38:56 $ + * Mise a jour: $Date: 2006/06/06 07:32:22 $ * par : $Author: ruchaud $ */ @@ -623,12 +623,17 @@ int rowsCount = 0; StreamTokenizer tokenizer; List row = new ArrayList(); + boolean stop = false; tokenizer = new StreamTokenizer(reader); tokenizer.eolIsSignificant(true); - while(tokenizer.nextToken() != StreamTokenizer.TT_EOF) { + while(!stop) { + tokenizer.nextToken(); + switch (tokenizer.ttype) { + case StreamTokenizer.TT_EOF: + stop = true; case StreamTokenizer.TT_EOL: if(!row.isEmpty()) { MatrixND matrix = getFactory().create(new int[]{1, row.size()}); @@ -675,7 +680,7 @@ /* Ajout d'un décalage de l'entete pour la dimenssion 2 */ writer.append(dimsCount == 2 ? " " + CSV_SEPARATOR : ""); for (Object semantic : listSemantics) { - writer.append(semantic + CSV_SEPARATOR); + writer.append("\"" + semantic + "\"" + CSV_SEPARATOR); } writer.append("\n"); } @@ -684,7 +689,7 @@ /* Ajout de la semantic devant la ligne pour la dimenssion 2 */ if(withSemantics && dimsCount == 2) { Object semantic = getSemantics(0).get(rowNb); - writer.append(semantic + CSV_SEPARATOR); + writer.append("\"" + semantic + "\"" + CSV_SEPARATOR); } for (int columnNb = 0; columnNb < columnsCount; columnNb++) {