Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Vector<Vector<Cell>> leerArchivoExcel(HSSFWorkbook archivo) {
- Vector<Vector<Cell>> cellVectorHolder = new Vector<Vector<Cell>>();
- try {
- HSSFSheet mySheet = archivo.getSheetAt( 0 );
- Iterator<Row> rowIter = mySheet.rowIterator();
- while (rowIter.hasNext()) {
- Row myRow = rowIter.next();
- Vector<Cell> cellStoreVector = new Vector<Cell>();
- int lastColumn = Math.max( myRow.getLastCellNum(), 5 );
- for (int cn = 0; cn < lastColumn; cn++) {
- Cell c = myRow.getCell( cn, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK );
- cellStoreVector.addElement( c );
- }
- cellVectorHolder.addElement( cellStoreVector );
- }
- } catch (Exception e) {
- LOG.error(e.getMessage());
- }
- return cellVectorHolder;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement