Microsoft Open XML Read Excel file using SAX method row by row and finding cell data

0 votes
I've looked through a number of posts on stockoverflow, but neither what I'm searching for nor posts that are similar to it appear to work for me. Rows cannot be read using OpenXmlReader since it never seems to expose the sheet data to a row element type.

I have to utilise OpenXmlPartReader's SAX function. I want to open the Excel file and read each row individually. I need to select a few cells for each row either by index number or id and the value in those cells. Because I am aware of which cells I need, I don't need to loop through all of them.
Jan 6, 2023 in Others by Kithuzzz
• 38,010 points
1,061 views

1 answer to this question.

0 votes
I faced a comparable challenge. A bespoke Sax reader that can extract all rows from the first sheet was created by me after integrating a number of relevant SO replies.

Please let me know how my xlsx-sax-exporter github project works for you by taking a look at it.

The reader opens the worksheet very quickly and determines its dimensions by using the SheetDimensions reference while building.

After examining the workbook's cell and numbering formats, it may additionally format numbers and dates. Even the normal numbering format scenarios are attempted to be covered.

Because I wanted to allow pulling paged results from the server and because it works best when all pages are retrieved sequentially, the reader uses paging. Sax streaming makes it blazingly fast as predicted, and memory utilisation is maintained to a minimum. Benchmarking this, it never uses more than 10 MB while avoiding holding rows in memory (release build).

If you have a change you'd like to suggest, feel free to fork and send a pull request. You can also just post an issue, and I'll attempt to fix it when I have time.
answered Jan 6, 2023 by narikkadan
• 63,420 points

Related Questions In Others

0 votes
0 answers

Data Driven Framework -- how to read and write in excel sheet using Selenium WebDriver with java

I'm using this code to read something, ...READ MORE

Oct 31, 2022 in Others by Kithuzzz
• 38,010 points
482 views
0 votes
1 answer

Excel VBA search based on cell values into folders and sub-folders to get the file path and data

This will create a listing of all ...READ MORE

answered Jan 19, 2023 in Others by narikkadan
• 63,420 points
1,613 views
0 votes
1 answer

How to copy entire data using row by row and paste to another sheet

Try this: Sub InsertData() Dim ...READ MORE

answered Feb 5, 2023 in Others by narikkadan
• 63,420 points
1,185 views
0 votes
1 answer

Removing specific rows in an Excel file using Azure Data Factory

Under the 'Source' tab, choose the number ...READ MORE

answered Sep 23, 2022 in Others by narikkadan
• 63,420 points
2,051 views
0 votes
1 answer

Obtaining Excel worksheet reference by worksheet name via C#

Instead of using Excel.Workbook.Sheets collection, it's easier to access Excel.Workbook.Worksheet collection, ...READ MORE

answered Nov 10, 2022 in Others by narikkadan
• 63,420 points
376 views
0 votes
1 answer

Calculate Birthdate from an age using y,m,d in Excel

Hello, yes u can find your birthdate using ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,670 points
1,439 views
0 votes
1 answer

Calculate Birthdate from an age using y,m,d in Excel

Hi To Calculate the date, we can ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,670 points
1,486 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,670 points
733 views
0 votes
1 answer

Excel VBA if file closed, then open and paste, else just paste data

Slightly re-worked to add full workbook/sheet qualifiers ...READ MORE

answered Sep 21, 2022 in Others by narikkadan
• 63,420 points
580 views
0 votes
1 answer

Uipath(RPA) : read data from the PDF file and write to Excel file

If you want to use UiPath and ...READ MORE

answered Oct 17, 2022 in Others by narikkadan
• 63,420 points
1,704 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP