java - Excel Cell data getting changed while using Apache POI -
this question has answer here:
- get cell value how presented in excel 2 answers
i using apache poi & java reading excel sheet , create file of format. noticed when number string read, code saves in number format. e.g.
12345677
becomes
1.2345e7
how format correctly?
current code
vector cellstorevector=(vector)dataholder.elementat(0); (int j=0; j < cellstorevector.size();j++){ hssfcell mycell = (hssfcell)cellstorevector.elementat(j); string stringcellvalue = mycell.tostring(); bufferedwriter.write(stringcellvalue + "|"); }
it happened me also. use below code while reading cell keep format string itself.
your_cell.setcelltype(cell.cell_type_string);
hope helps.
similar question asked here.
Comments
Post a Comment