I have a CSV file, I am converting the CSV file into Excel using EpPlus
, it is successfully converting to Excel but I have a problem, In the CSV file I have comma separated values in a column, so when EpPlus converts the CSV file into Excel these comma separated values are showing in individual columns in the generated Excel file.
Is there any way to resolve this issue?
This is the code which I am using to convert the CSV to Excel
using (ExcelPackage package = new ExcelPackage(new FileInfo(excelFilePath)))
{
ExcelWorksheet worksheet = package.Workbook.Worksheets.Add(worksheetsName);
worksheet = package.Workbook.Worksheets.Add(worksheetsName);
worksheet.Cells["A1"].LoadFromText(new FileInfo(csvFilePath), format, OfficeOpenXml.Table.TableStyles.None, firstRowIsHeader);
package.Save();
}
I am facing one more issue, I have time, date columns in the CSV file (both are individual columns) but in the generated excel file the format of time and date columns are not correct. For example if the time value in the CSV file is "12:00:00 AM" in the output Excel it is showing as 42639 and for the date 11/21/2016 it is showing as 42695. How can I correct the format issue?
One more question, Does EpPlus support XML to Excel spreadsheet conversion?