The Syncfusion .NET Excel (XlsIO) Library provides comprehensive support for converting Excel workbooks to CSV format. With it, you can convert workbooks from xlsx, xls, xlsm, and xltm formats. Also, you can save CSV documents with custom separators instead of the default comma separator.
This example code shows how to save an Excel workbook as a CSV file by using the Syncfusion® .NET Excel Library with just a few lines of C#.
// Initialize Excel engine and application.
using ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Xlsx;
// Open an existing workbook.
using FileStream inputStream = new FileStream("InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream);
// Save the workbook in CSV format with comma (,) as delimiter.
using FileStream outputStream = new FileStream("Excel to CSV.csv", FileMode.Create, FileAccess.ReadWrite);
workbook.SaveAs(outputStream, ",");
Read our knowledge base articles to learn more about converting Excel workbooks to CSV format:
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
The Syncfusion Excel Library allows a maximum of 1,048,576 rows and 16,384 columns when loading or saving a CSV document. However, these limits can be adjusted by modifying the MaximumRowsForCsv and MaximumColumnsForCsv properties.
Yes. The Syncfusion Excel library provides support for both reading and writing CSV documents, so you can open any CSV file and save it after changing it.
As per the CSV document specification, only text content can be preserved. The Syncfusion Excel Library preserves number formatting in cells when converting an Excel workbook to CSV.
Yes, it is possible to merge multiple Excel workbooks into a single CSV file by using the Syncfusion Excel Library.
Double quotation marks (“) are used as the qualifier value in CSV files produced by the Syncfusion Excel Library.
Yes, you can convert Excel workbooks that include calculated values to CSV files. The Syncfusion Excel Library calculates the formula values and includes them in the exported CSV file.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.