The Syncfusion .NET Excel Library (XlsIO) offers comprehensive support for converting CSV files to Excel format. It allows users to create Excel documents from CSV files, supporting various CSV formats. Formats such as CSV, TXT, and other delimited files can be converted into Excel formats like .xlsx, .xls, .xlsm, and .xltm.
This example code shows how to save a CSV file as an Excel document using the Syncfusion .NET Excel Library with just a few lines of code in C#.
// Initialize Excel engine and application.
using ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Xlsx;
// Open an existing CSV file with comma separator.
using FileStream inputStream = new FileStream("InputTemplate.csv", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream, ",");
// Save the CSV data as an Excel file.
using FileStream outputStream = new FileStream("CSV to Excel.xlsx", FileMode.Create, FileAccess.ReadWrite);
workbook.SaveAs(outputStream);
Discover valuable resources from our blog and knowledge base to enhance your efficiency in converting CSV data to Excel format.
Knowledge base
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
To open a CSV file, you must specify its delimiter. If the delimiter is a comma (,), no specification is needed, as the Syncfusion Excel library defaults to a comma (,). However, for delimiters like tab (\t), semicolon (;), colon (:), space ( ), or the equals sign (=), you must specify the delimiter during opening to ensure accurate parsing and handling of CSV data.
To open an existing TSV (tab-separated values) file using the Syncfusion Excel Library, you need to specify the tab delimiter before opening the document using the Excel library.
The double quotes symbol is used as the qualifier value.
Yes. Syncfusion provides support for XLSX-to-CSV conversion. You can specify the required delimiter when saving the CSV document.
The Syncfusion Excel Library allows a maximum of 1,048,576 rows and 16,384 columns when loading or saving a CSV document.
Yes, it is possible to merge multiple CSV files into a single Excel file using the Syncfusion Excel Library.
Yes. Syncfusion Excel Library provides support for both reading and writing CSV documents. So, you can open any CSV document and save it after the changes are finished.
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.