How to convert csv file to excel using java


In this article, I am going to explain to you how to convert csv file to excel file, here I am taking sample csv file which contains more than 50k records and using Apache POI library I am creating new sheet in the excel file and adding all the records


I have created a simple class which is an ExcelWriter using which we can create a sheet, row, and cell and also populate cells with data, so I am using below code to create sheet and populate csv data

The below code will read the data from the csv file and iterate it and create a new record in the excel file

Download Code