how to saving data in csv file

I have problem with saving data in csv file. I would like save my data look

like this example :

excel preview :

ABC

1 101112

2 131415

As we see all values are in separate cell A1=10, B1=11, C1=12 ...

so I try :

PrintWriter wy = new PrintWriter(new FileWriter("test.csv"));

values[0][0]="10";

values[0][1]="11";

values[0][2]="12";

values[1][0]="13";

values[1][1]="14";

values[1][2]="15";

for (String[] row : values){

for (String col : row) {

wy.print(col + "\t");

}

}

but csv file look like :

A1=10 11 12

A2=13 14 15

but B1-B2 and C1-C2 is empty

the second steep is use Ostermiller library :

OutputStream out;

out = new FileOutputStream("temp.csv");

CSVPrinter csvp = new CSVPrinter(out);

String[][] values = new String[2][3];

csvp.changeDelimiter('\t');

values[0][0]="10";

values[0][1]="11";

values[0][2]="12";

values[1][0]="13";

values[1][1]="14";

values[1][2]="15";

csvp.println(values);

but the result is also this same, is anyone do how to resolve this problem

?

[1205 byte] By [tomassa] at [2007-11-27 3:44:51]
# 1
Crossposted in Java Programming. Doesn't belong here anyway.
DrClapa at 2007-7-12 8:48:32 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

CSV stands for "Comma Separated Values" which is a deceptive term when it comes to opening CSV files with Microsoft Excel because the default column separators are not commas but semicolons. If you want to use some other separator, you must use the Text Import Wizard as described here:

http://office.microsoft.com/en-us/excel/HA010552851033.aspx

Note:

The PrintWriter-related example prints out nothing, so some line printing command should be included in the outer loop, like this:...

for (String[] row : values) {

for (String col : row) {

wy.print(col + "\t");

}

wy.println();

}

...

prgguya at 2007-7-12 8:48:32 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...