Aspose.Cells Opening CSV file as new Workbook is very slow

I am using the latest download of Aspose.Cells for .NET, version 7.3.0.0. I am opening a CSV file using the Workbook class. The CSV file is 1.12 MB in disk size, having 6,334 rows and 14 columns.


It takes 2 minutes to open the workbook. The rest of my processing is fine, but two minutes seems excessive just to open the file.

I have attached the file to this post.

My code is as follows:

Aspose.Cells.License asposeLicense = new Aspose.Cells.License();
asposeLicense.SetLicense(“Aspose.Cells.lic”);

LoadOptions loadOptions = new LoadOptions(LoadFormat.CSV);
loadOptions.ConvertNumericData = false;
Workbook wb = new Workbook(_PhysicalFile, loadOptions); // Take 2 minutes here.
Worksheet ws = wb.Worksheets[0];

object[,] dataArray = ws.Cells.ExportArray(3, 0, ws.Cells.MaxDataRow + 1, ws.Cells.MaxDataColumn + 1);
Int32 numRows = dataArray.GetUpperBound(0);
Int32 numCols = dataArray.GetUpperBound(1);

*** The remaining code simply loops through the array, validates the data in each column, and constructs a database record, and save the record to SQL Server. ***


Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please download and use the latest version:
Aspose.Cells
for .NET v7.3.0.5
. It should fix the loading time.

Please let us know your feedback.

Hi,

Please add following code for the load option:

loadOptions.ConvertNumericData = false;
loadOptions.ConvertDateTimeData = false;


Thank you.

Hi,


And, your updated code may look like as following:

Aspose.Cells.License asposeLicense = new Aspose.Cells.License();
asposeLicense.SetLicense(“Aspose.Cells.lic”);

TxtLoadOptions loadOptions = new TxtLoadOptions(LoadFormat.CSV);
loadOptions.ConvertNumericData = false;
loadOptions.ConvertDateTimeData = false;
Workbook wb = new Workbook(_PhysicalFile, loadOptions);
//…

I have tested with your file and it works fine and opens the file very quickly.

thank you.

Thank you very much. Downloading the latest version and adding the code above has reduced the time to open these files from 2 minutes to less than 10 seconds.


Again, thank you for your help and quick turnaround of this issue.

David Nowak.

Hi David,


Good to know that your issue is sorted out.

Feel free to contact us any time, if you need further help.

Thank you.