We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Close Icon
Unfortunately, activation email could not send to your email. Please try again.
Close Icon
close icon
Vote for your favorite ebook
Succinctly Readers Awards 2020
Syncfusion Feedback

Fastest way to parse an Excel file?

Thread ID:





108510 Apr 25,2013 01:10 AM UTC May 2,2013 09:10 AM UTC WinForms 1
Tags: PDF
Josh Santangelo
Asked On April 25, 2013 01:10 AM UTC

I am using XlsIo to parse large (50k rows) Excel documents. This takes a while. I'm not expecting it to be instant, but I'm wondering if there's any simple tricks to improve performance. An example of my current code:

using (ExcelEngine ee = new ExcelEngine())
    IWorkbook workbook = await ee.Excel.Workbooks.OpenAsync(await schema.OpenStreamForReadAsync());
    IEnumerable<IRange> rows = workbook.Worksheets[0].Rows.Skip(1);

    foreach (IRange row in rows)
        double latitude = row.Columns[0].Number;
        double longitude = row.Columns[1].Number;
        if (!double.IsNaN(latitude) && !double.IsNaN(longitude))
            Location location = new Location(latitude, longitude);

For my test spreadsheet, this is taking about six seconds. The spreadsheet has nine columns, and if I remove all but the first two (which I'm actually interested in), I can get this down to under two seconds.

I notice that XlsIo tries to parse the values of each cell in a number of ways, which gives you nice Number and DateTime properties, but this probably has a performance cost. Is there any way to customize this behavior? I'd like to tell the parser: "the first two columns are numbers, don't do anything with the rest", or "columns zero and one are numbers, two is a DateTime, so don't try to parse dates into numbers or anything".

Or maybe there's some other trick I'm missing?

Manoj Kumar G M [Syncfusion]
Replied On May 2, 2013 09:10 AM UTC

Hi Josh,

Thank you for choosing Syncfusion products.

We have already logged a feature report to improve performance while parsing large document and it will be implemented in any of our forth-coming releases. We will get back to you once the feature has been implemented

Please let us know if you require any further clarifications.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon