# run io_ms_excel2.py example first!
from org.apache.poi.xssf.usermodel import XSSFWorkbook
from org.apache.poi.ss.usermodel import Cell
from java.io import *
f=FileInputStream(File("table2.xlsx"));
wb = XSSFWorkbook(f)
sheet=wb.getSheetAt(0) # first sheet from the workbook
elist=[]
row= sheet.iterator()
while (row.hasNext()):
r = row.next();
c = r.cellIterator();
lrow=[]
while(c.hasNext()):
cell=c.next()
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC):
lrow.append(cell.getNumericCellValue())
if (len(lrow)>0):elist.append(lrow)
print elist
Ads help maintain this website.