I'm having some problems converting an excel
file to csv
format with C#
and NPOI
library.
I have to return an error in case there is a multiline cell like the following
|"" | |text| |text|
The output of the csv
file is expected to be:
"",
text,
text,
How can I detect it and throw
an error
?
for (int row = 0; row <= sheet.LastRowNum; row++)
{
for (int cell = 0; cell < sheet.GetRow(row).Cells.Count ; cell++)
{
csvData += sheet.GetRow(row).Cells[cell].ToString() + ",";
}
csvData += "\n";
}