Hi Team,
I am generating a .xlsx file by combing .csv files. The date format in cell and the formula bar of csv file ‘DD-MM-YYYY’ .
CSVDateFormat.PNG (2.2 KB)
The same csv is combined to forma a excel file where the date format in cell in ‘DD-MM-YYYY’ ExcelCellFormat.PNG (833 Bytes)
and ‘MM-DD-YYYY’ ExcelFormulaBarFormat.PNG (1.6 KB).
Server
Linux OS
Tomcat v8
Code snippet used to merge CSV to Excel:
Workbook ExcelWorkbook = new Workbook();
//In a for loop of number of csv files present
Workbook wb = new Workbook(“Path to csv file”, opt);
Worksheet ws = wb.getWorksheets().get(0);
…
//First csv to be copied to excel
if (FirstCSV) {
ExcelWorkbook .copy(wb);
} else {
//Second CSV onward, should be appended to the existing excel
ExcelWorkbook .combine(wb);
}
wb.dispose();
ExcelWorkbook .dispose();
I am using Aspose aspose-cells.18.5.jar. Kindly let me know how it can be done.
Thanks