0

Is it possible to convert a .csv file to .xlsb programatically ? (Preferrably C#)

Convert XLS to XLSB Programatically?

shows how to convert XLS to XLSB , can I use the same to convert it from.csv? Won't there be any formatting issues? I am doing this on the server side because the .xlsb file size is very small compared to a .csv file, and I don't have an option of zipping my file.

2 Answers 2

3

Take a look at EPPlus. I have used this extensively with great success. Fantastic Excel library and it's open source.

And, yes, there certainly will be formatting issues. You cannot go from XLS to CSV and maintain any of the original formatting because .CSV is pure text.

Sign up to request clarification or add additional context in comments.

3 Comments

I don't think excelpackage has the capability to do this, I am already using it in my application.
It can be done. Here is an example: codejournal.blogspot.com/2012/03/…
That shows the conversion from xlsx to csv , I need it for csv to xlsb. The thing is , while converting a file to xlsb , we get some errors. For the rest of the conversions , it's fine. Thanks for your interest though , appreciate it. :)
0

Aspose.Cells File Format API can convert your CSV file to XLSB format. Please see the following sample code and screenshots for your reference.

C#

// Directory path for input and output files.
string dirPath = "D:\\Download\\";

// Load your sample CSV file inside the Workbook object.
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(dirPath + "sampleConvertCSVToExcelFormats.csv");

// Save CSV file to XLSB format.
wb.Save(dirPath + "outputConvertCSVToExcelFormats.xlsb", SaveFormat.Xlsb);

Screenshots of Sample CSV and Output XLSB files

Sample CSV File: Sample CSV file to be converted to Excel formats using Aspose.Cells API

Output XLSB file Convert CSV to XLSB format using Aspose.Cells API

Thank you and regards.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.