问题
I have downloaded latest POI version 3.5. I want to read the Excel file (.xlsx format) using the POI.
If anybody has any Example source code or any URL or any other code snippet which can read the Excel file (.xlsx format) using the latest version of POI,which would be appreciated.
Thanks,
Mishal Shah
回答1:
Here is the XLSX to CSV Converter example for POI, and you can dig into svn for more examples here
回答2:
Below is the code snipet which can help you for reading excel 2007 format file... Actually there are 2 diff class for reading excel file one is for the up to excel 2003 and one is latest one...
Code >>>
InputStream inputStream = new FileInputStream(destDir);
POIFSFileSystem fileSystem = new POIFSFileSystem(inputStream);
XSSFWorkbook workBook = new XSSFWorkbook(salesFileName);
XSSFSheet sheet = workBook.getSheetAt(0);
totalRows = sheet.getPhysicalNumberOfRows();
System.out.println("total no of rows >>>>"+totalRows);
来源:https://stackoverflow.com/questions/1895483/excel-2007-xlsx-reading-code-using-poi-3-5-in-java