How to update an excel dynamically in java
I am designing stock market predictor wherein the user is supposed 开发者_如何学Goto update his database of historical indexes through the web. I want to just add the new data to the TOP of my excel file. not Bottom but on Top of my file. Now i know i can make a copy and modify that copy and the regular stuff. How to do i avoid this complicated steps and do in few steps instead? is it possible to do this without making a copy
Apache POI's Sheet
objects have a shiftRows
method you could use to do this. Here's an example from the Busy Developers' Guide to HSSF and XSSF Features:
- Shift rows up or down on a sheet
- shiftRows API documentation
Here's an answer with some sample code:
- How to create new rows in apache poi 3.6?
Why not update a .csv (which is easier) and at the end after all updates are done, convert it to .xls
精彩评论