• Post Reply Bookmark Topic Watch Topic
  • New Topic

Get int value from Excel cell  RSS feed

 
bhaskar bolo
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Spoor. I got it. I Realy enjoy with your help . I have one more doubt. In my xlsx contain many columns of integer and strings can you please tel me to how to retrive Integers


Thanks

Bhaskar
 
Rob Spoor
Sheriff
Posts: 20903
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had to look in your post history to see this is actually a follow-up to this thread. Next time, please either post in the existing thread (what I think you tried to do but you pressed the wrong button), or a) UseAMeaningfulSubjectLine and b) TellTheDetails.

If you look at the Javadoc page of XSSFCell you'll find one method for retrieving the value of a cell as a number - getNumericCellValue(). That returns a double, but if you're sure the value is an int then simply cast that value to int: (int)cell.getNumericCellValue().
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!