Reading string value from Excel with HSSF but it's double

Posted by egaga on Stack Overflow See other posts from Stack Overflow or by egaga
Published on 2009-09-11T14:17:34Z Indexed on 2010/04/20 1:43 UTC
Read the original article Hit count: 389

Filed under:
|
|

Hi, I'm using HSSF-POI for reading excel data. The problem is I have values in a cell that look like a number but really are strings. If I look at the format cell in Excel, it says the type is "text". Still the HSSF Cell thinks it's numeric. How can I get the value as a string?

If I try to use cell.getRichStringValue, I get exception; if cell.toString, it's not the exact same value as in Excel sheet.

Thanks!

edit: until this gets resolved, I'll use new BigDecimal(cell.getNumericCellValue()).toString()

© Stack Overflow or respective owner

Related posts about excel

Related posts about java