hi,
I've hit a stumbling block. My app happily reads in my spreadsheet, however a new request has been made that after reaching the end of a record the cellNum((short) 0) should be updated to "P".
This would sound a simple task, however I can't get it to work for the life of me. At the point I want to update cell 0 I am at cell 26. Is there any way to open a fileinputstream and fileoutputstream on the same workbook so that you can modify and read at the same time.
the apache website is very limited in what it offers as the way of tutorials.
A segment of what i'm doing is below:
POIFSFileSystem fs =
new POIFSFileSystem(new FileInputStream(fileName));
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(1);
HSSFRow row = sheet.getRow(1);
for (Iterator cit = row.cellIterator(); cit.hasNext() {
HSSFCell cell = (HSSFCell) cit.next();
...processing
if (cell.getCellNum() == 26) {update cell(0) to value "P"}
Many thanks if anyone can point me in the right direction.
I've hit a stumbling block. My app happily reads in my spreadsheet, however a new request has been made that after reaching the end of a record the cellNum((short) 0) should be updated to "P".
This would sound a simple task, however I can't get it to work for the life of me. At the point I want to update cell 0 I am at cell 26. Is there any way to open a fileinputstream and fileoutputstream on the same workbook so that you can modify and read at the same time.
the apache website is very limited in what it offers as the way of tutorials.
A segment of what i'm doing is below:
POIFSFileSystem fs =
new POIFSFileSystem(new FileInputStream(fileName));
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(1);
HSSFRow row = sheet.getRow(1);
for (Iterator cit = row.cellIterator(); cit.hasNext() {
HSSFCell cell = (HSSFCell) cit.next();
...processing
if (cell.getCellNum() == 26) {update cell(0) to value "P"}
Many thanks if anyone can point me in the right direction.