EasyXLS™ library allows you to import data from CVS file to Excel.
EasyXLS can be successfully used inclusively to convert large CSV files to Excel, CSV files with big volume of data with fast conversion time.
EasyXLS permits you to convert CSV to Excel file without Excel installed, without Interop or any other additional software installed.
The conversion is made in two steps. First, the CSV file is imported and after that, the data is exported to Excel file. Once the CSV was loaded in memory, optionally, the user can process data, add more features (like formulas, cell formatting, comments, hyperlinks, images, data validations, page setup, charts, so on) and save the file back in any Excel format like XLSX, XLSB or XLS file format.
// Create an instance of the class used to import/export Excel files
ExcelDocument workbook = new ExcelDocument();
// Import CSV file
workbook.easy_LoadCSVFile("C:\\Samples\\file.csv");
//Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\CSV to Excel.xlsx");
' Create an instance of the class used to import/export Excel filesDim workbook As New ExcelDocument
' Import CSV file
workbook.easy_LoadCSVFile("C:\Samples\file.csv")
' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\CSV to Excel.xlsx")
C++// Create an instance of the class used to import/export Excel files
EasyXLS::IExcelDocumentPtr workbook;
hr = CoCreateInstance(__uuidof(EasyXLS::ExcelDocument),
NULL,
CLSCTX_ALL,
__uuidof(EasyXLS::IExcelDocument),
(void**) &workbook) ;
// Import CSV file
workbook->easy_LoadCSVFile_2("C:\\Samples\\file.csv");
// Export Excel file
workbook->easy_WriteXLSXFile("C:\\Samples\\CSV to Excel.xlsx");
Click here to see Continuous Code ListingC++.NET// Create an instance of the class used to import/export Excel files
ExcelDocument ^workbook = gcnew ExcelDocument();
// Import CSV file
workbook->easy_LoadCSVFile("C:\\Samples\\file.csv");
// Export Excel file
workbook->easy_WriteXLSXFile("C:\\Samples\\CSV to Excel.xlsx");
Click here to see Continuous Code Listing
// Create an instance of the class used to import/export Excel files
ExcelDocument workbook = new ExcelDocument();
// Import CSV file
workbook.easy_LoadCSVFile("C:\\Samples\\file.csv");
// Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\CSV to Excel.xlsx");
.NET:// Create an instance of the class used to import/export Excel files
$workbook = new COM("EasyXLS.ExcelDocument");
// Import CSV file
$workbook->easy_LoadCSVFile_2("C:\Samples\file.csv");
// Export Excel file
$workbook->easy_WriteXLSXFile("C:\Samples\CSV to Excel.xlsx");
Click here to see Continuous Code ListingJava:// Create an instance of the class used to import/export Excel files
$workbook = new java("EasyXLS.ExcelDocument");
// Import CSV file
$workbook->easy_LoadCSVFile("C:\Samples\file.csv");
// Export Excel file
$workbook->easy_WriteXLSXFile("C:\Samples\CSV to Excel.xlsx");
Click here to see Continuous Code Listing
' Create an instance of the class used to import/export Excel filesset workbook = Server.CreateObject("EasyXLS.ExcelDocument")
' Import CSV file
workbook.easy_LoadCSVFile_2("C:\Samples\file.csv")
' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\CSV to Excel.xlsx")
' Create an instance of the class used to import/export Excel filesSet workbook = CreateObject("EasyXLS.ExcelDocument")
' Import CSV file
workbook.easy_LoadCSVFile_2("C:\Samples\file.csv")
' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\CSV to Excel.xlsx")
' Create an instance of the class used to import/export Excel filesset workbook = CreateObject("EasyXLS.ExcelDocument")
' Import CSV file
workbook.easy_LoadCSVFile_2("C:\Samples\file.csv")
' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\CSV to Excel.xlsx")
<!-- Create an instance of the class used to import/export Excel files --><cfobject type="java"class="EasyXLS.ExcelDocument"name="workbook"action="CREATE"><!-- Import CSV file --><cfset ret = workbook.easy_LoadCSVFile("C:\Samples\file.csv")><!-- Export Excel file --><cfset ret = workbook.easy_WriteXLSXFile("C:\Samples\CSV to Excel.xlsx")>
.NET:# Create an instance of the class used to import/export Excel files
workbook = ExcelDocument()
# Import CSV file
workbook.easy_LoadCSVFile("C:\\Samples\\file.csv")
# Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\CSV to Excel.xlsx")
Click here to see Continuous Code ListingJava:# Create an instance of the class used to import/export Excel files
workbook = gateway.jvm.ExcelDocument()
# Import CSV file
workbook.easy_LoadCSVFile("C:\\Samples\\file.csv")
# Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\CSV to Excel.xlsx")
Click here to see Continuous Code Listing
The screen shot below represents the CSV file that will be converted to Excel by the code sample above.
The screen shots below represents the converted CSV file to Excel in the above code sample.
Convert CSV to XLSX
EasyXLS allows you to convert CSV to Excel XLSX file. The above code sample shows how to achieve this goal, by using ExcelDocument.easy_WriteXLSXFile method.
EasyXLS allows you to convert CSV to Excel XLSB file. Similarly, as shown in the above code sample, using ExcelDocument.easy_WriteXLSBFile method, the CSV file can be converted to XLSB file.
EasyXLS allows you to convert CSV to Excel XLS file. Similarly, as shown in the above code sample, using ExcelDocument.easy_WriteXLSFile method, the CSV file can be converted to XLS file.