I want to insert a new column in between the existing columns of the excel which is in .xls format using Java retaining the existing format. Is there any api to do so?
Asked
Active
Viewed 190 times
1 Answers
3
You can use the Apache POI library to modify an Excel file.
Quick Guide: https://poi.apache.org/components/spreadsheet/quick-guide.html
You'll want to:
- Load your Excel file as a
Workbook
. - Open the correct
Sheet
. - Insert your new column using Sheet#shiftColumns.
- Save the modified
Workbook
back to an Excel file.

bcody
- 2,489
- 1
- 21
- 21