How to save an excel file as csv using NPOI?
I have tried below.
//corrupt csv/excel
using (var csvStream = new FileStream(csvPath, FileMode.Create, FileAccess.Write))
{
workBook.Write(csvStream);
}
//empty file
using (FileStream fs = new FileStream(excelPath, FileMode.Open, FileAccess.Read))
{
using (var csvStream = new FileStream(csvPath, FileMode.Create, FileAccess.Write))
{
fs.Position = 0;
fs.CopyToAsync(csvStream);
}
}
question from:
https://stackoverflow.com/questions/66068285/save-excel-file-or-worksheet-as-csv-using-npoi 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…