Thank you. I tried using that logic but it gives me some junk value if the cell contains only a date( in the form 8/3/2005 or any other form)
Thank You Kalkunda Venkat GFRIS - Principal Financial Group Ph: (515) 362 1388 -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 04, 2005 1:54 PM To: POI Users List Cc: [email protected] Subject: Re: HSSFCell object. You can use the following logic: switch (cell.getCellType()) { case HSSFCell.CELL_TYPE_FORMULA : value = "FORMULA value=" +cell.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_NUMERIC : value = "NUMERIC value=" + cell.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_STRING : value = "STRING value=" + cell.getStringCellValue(); break; default : } System.out.println("CELL col=" + cell.getCellNum() + " VALUE=" + value); Hope this will help. Michael D. "Kalkunda, Venkat" <[EMAIL PROTECTED] To: <[email protected]> ncipal.com> cc: Subject: HSSFCell object. 08/04/2005 02:22 PM Please respond to "POI Users List" Hi, I am using this snippet of code in one of my projects. HSSFCell cell = null; HSSFWorkbook wb = new HSSFWorkbook(file); HSSFSheet workSheet = wb.getSheetAt(sheetNum) cell = row.getCell(columnNum); **variable = cell.getNumericCellValue();** The starred line of code is where I need help. The cell that I am trying to retreive value from can contain a number or a String or a Date or any series of characters. It may be just number, or just String of characters or just date. What method or what logic can I use so that I can retreive the value of the cell, whatever may be the contents.I can check if it just a number or if it is just a string but if it is a date I don't know how I can verify that. Can you give me some suggestions? Thank You Kalkunda Venkat GFRIS - Principal Financial Group Ph: (515) 362 1388 -----Message Disclaimer----- This e-mail message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply email to [EMAIL PROTECTED] and delete or destroy all copies of the original message and attachments thereto. Email sent to or from the Principal Financial Group or any of its member companies may be retained as required by law or regulation. Nothing in this message is intended to constitute an Electronic signature for purposes of the Uniform Electronic Transactions Act (UETA) or the Electronic Signatures in Global and National Commerce Act ("E-Sign") unless a specific statement to the contrary is included in this message. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ -----Message Disclaimer----- This e-mail message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply email to [EMAIL PROTECTED] and delete or destroy all copies of the original message and attachments thereto. Email sent to or from the Principal Financial Group or any of its member companies may be retained as required by law or regulation. Nothing in this message is intended to constitute an Electronic signature for purposes of the Uniform Electronic Transactions Act (UETA) or the Electronic Signatures in Global and National Commerce Act ("E-Sign") unless a specific statement to the contrary is included in this message. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
