Updating a hashmap dating application for dating my daughter
Next line gives us a worksheet from book, and from there we are just going through each row and then each column. You can see we have used two for loop, one to iterate over all rows and inner loop is to go through each column.
Cell represent a block in Excel, also known as cell. Writing into Excel file is also similar to reading, The workbook and worksheet classes will remain same, all you will do is to create new rows, columns and cells.
Just like before reading we need to determine type of cell, we also need to do the same thing before writing data into cell. Remembering them can be hard but you can always refer to their online Javadoc.Once you are done creating new rows in your Excel file in memory, you need to open an output stream to write that data into your Excel File.This will save all update you made in existing file or in a new file which is created by Java's File class.If you have Maven and Eclipse plugin installed, instead create a Maven Java project, this will also help you to download Apache POI Jar files.format in Java, which is key to support old Microsoft Excel files created using Microsoft Office version prior to 2007.
Though there are couple of other alternative libraries to read Excel files from Java program, but Apache POI is the best one and you should use it whenever possible.