Adding numeric field data to a File

Can anyone tell me how i can write int values to the file?

My excel sheet has String, numeric, String, String, String data

From POI HSSF i get the string values as String, and i am casting the numeric values to int (since POI hssf returns double)

When addind data to the file, the string values are taken fine.. but not the numeric values.. a '?' is put instead of the int value (which is 4 -6 digit long)

DO i have to change to char buffer or something?

[CODE]

BufferedWriter out = new BufferedWriter(new FileWriter(file.txt, true));

if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC)

int valInt = (int) cell.getNumericCellValue();

out.write(vallnt);

out.close();

[/CODE]

Please let me know if anyne has suggestions

Thanx

[846 byte] By [javainstead] at [2007-9-30 4:17:07]
# 1
Please ignore thisi got the solution. As said my paul in my previous msg.. use printwriter and use its print and println methods.thanx
javainstead at 2007-7-1 12:29:08 > top of Java-index,Archived Forums,Java Programming...