java - Reading Category and Items From excel -


my excel file

i wanna read category excel file cant read row number because items may vary. using jxl. can take each cell type im getting type label every cell

try {         workbook workbook = workbook.getworkbook(new file(                 "path excel file"));         sheet sheet = workbook.getsheet(0);         int colcount = sheet.getrows();         (int = 0; < colcount; i++) {             cell cell = sheet.getcell(0, i);             system.out.println(cell.gettype() + " " + cell.getcontents());         }     } catch (biffexception e) {         // todo auto-generated catch block         e.printstacktrace();     } catch (ioexception e) {         // todo auto-generated catch block         e.printstacktrace();     } 

i need take category names separately.

as alternative, read column quantity.

the first row contains "category" - retrieve , save (or whatever). retrieve numeric value cell, call sum. then, continue reading thw cells below. retrieve numeric value , subtract sum. if sum reduced 0, increment row, , repeat, unless exceed number of rows.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -