Insert a new column in between to an existing excel file using apache POI

折月煮酒 提交于 2020-07-22 21:34:05

问题


I have an excel file which have 2 columns. I want to add a new column in between existing first and second using java program. I am trying to use Apache POI for this purpose. I went through the api docs and some of the related stack over flow questions but I could find examples which only delete/update the cells(not inserting an entire column).

Can any one share useful pointer to this? The only solution which I can think as if now is create a new sheet with 3 columns copy 1st column and 3rd column value from old


回答1:


I found a solution https://github.com/bit-twit/poi-shift-column/blob/master/src/main/java/org/bittwit/poi/ExcelOpener.java. It's working fine.



来源:https://stackoverflow.com/questions/46405454/insert-a-new-column-in-between-to-an-existing-excel-file-using-apache-poi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!