java - Excel Cell data getting changed while using Apache POI -


this question has answer here:

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

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -