In my work i am using cells-2.3.1.jar. I want to filter columns and work with those filtered values, without save to file and reload it, just working in memory.
This is my code:
Worksheet worksheet = workbook.getWorksheets().getSheet(0);
AutoFilter autoFilter = worksheet.getAutoFilter();
autoFilter.filter(2, nameValue);
autoFilter.filter(4, countryValue);
// At this point if I insert workbook.save("file.xls"), this file contains the right values
//But I don't need and don´t want to write to disk
//However shows all the values
Cells cells = worksheet.getCells();
for (int fila = 1; fila <= cells.getMaxRow(); fila++) {
System.out.println("Name: " + ((String) cells.getCell(fila,2).getValue()).trim());
System.out.println("Country: " + ((String) cells.getCell(fila, 4).getValue()).trim());
}
Sorry for my english. Thanx in advance.