开发者

How to update an excel dynamically in java

开发者 https://www.devze.com 2023-02-12 03:19 出处:网络
I am designingstock 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 fi

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号