Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
603 views
in Technique[技术] by (71.8m points)

c# - Save excel file or worksheet as csv using NPOI

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...