How to convert csv file to excel using java

Posted in Java By Raj On October 20, 2017


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 

  • Raghu Cherukuru

    I need a help that is i have a csv file and i want to convert it into xls file using data mapping. Could you please help me ,if you are ok with this request i will send csv file.