Reading date values from excel cell using POI HSSF API

You could take a look at: HSSFDateUtil.isCellDateFormatted() See the POI Horrible Spreadsheet Format API for more details on HSSFDateUtil: http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFDateUtil.html That also provides some helper methods for returning Excel getExcelDate() and Java dates getJavaDate(). You need to be somewhat wary of different date formats though…

How to insert a row between two rows in an existing excel with HSSF (Apache POI)

Helper function to copy rows shamelessly adapted from here import org.apache.poi.hssf.usermodel.*; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.util.CellRangeAddress; import java.io.FileInputStream; import java.io.FileOutputStream; public class RowCopy { public static void main(String[] args) throws Exception{ HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(“c:/input.xls”)); HSSFSheet sheet = workbook.getSheet(“Sheet1”); copyRow(workbook, sheet, 0, 1); FileOutputStream out = new FileOutputStream(“c:/output.xls”); workbook.write(out); out.close(); } private static void … Read more

tech