On 5 mrt, 03:35, "John B. Matthews" <nos...@nospam.invalid> wrote:
In article
<fe4b2ccd-e3aa-45fb-972a-f9614cdd1...@i25g2000yqm.googlegroups.com>,
dendeezen <tsd35...@scarlet.be> wrote:
Thanks for helping, I tried lots of things, but I can't find the
solutuion. Hereby my code, I guess the solution is trivial. How can I
dump the values from Lezen.leesL6 into the Array, where now, for
testing, figures 12345?
As the Sheet may be sparse, the Iterator<Row> and Iterator<Cell> only
return physically defined Rows and Cells, so you'd need an extensible
collection:
List<List<Cell>> array = new ArrayList<List<Cell>>();
...
Workbook book = new HSSFWorkbook(...);
Sheet sheet = book.getSheetAt(...);
for (Row row : sheet) {
List<Cell> arrayRow = new ArrayList<Cell>();
array.add(arrayRow);
for (Cell cell : row) {
arrayRow.add(cell);
}
}
Then you can access the new array as needed:
for (List<Cell> row : array) {
for (Cell cell : row) {
// System.out.println(cell.toString());
}
}
But I don't see the point: why not just use the Sheet itself?
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
Thanks for the great help.
means to int, but I found my way out.