question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Read data by rows(horizontal way)

See original GitHub issue

Hey,

I just started to use the library from the base example:

using (var stream = File.Open(filePath, FileMode.Open, FileAccess.Read)) {
	using (var reader = ExcelReaderFactory.CreateReader(stream)) {
		do {
			while (reader.Read()) {
				// reader.GetDouble(0);
			}
		} while (reader.NextResult());
	}
}

reader.Read() runs by columns(in vertical way): image

Can I read the data by rows?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
andersnmcommented, Sep 4, 2017

Hi! Can confirm latest ExcelDataReader parses 2 columns and 9 rows out of test3.xlsx, but the file has data in 3 columns (and 9 rows). Thanks for the sample file and mentioning the origin.

Dimension element in sheet1.xml is:

<dimension ref="A1:B1" />

Looks like the pdfConvertor generates xlsx with a broken dimension element. ExcelDataReader uses this element (if present) to determine the number of columns in the sheet.

In order to fix this in ExcelDataReader, I suspect there is no way around taking the performance hit and always scan the xlsx sheet data once first to find the maximum extents (as for xls).

0reactions
butsatycommented, Sep 5, 2017

By the way, it is possible to read it with EPPlus

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Ways to Transpose Data Horizontally in Excel
This is a straightforward way to transpose vertical rows into horizontal columns by copying the data in rows and pasting it into columns....
Read more >
Transpose (rotate) data from rows to columns or vice versa
Transpose (rotate) data from rows to columns or vice versa · Select the range of data you want to rearrange, including any row...
Read more >
How To Paste Horizontal Data Vertically in Excel (Plus Tips)
1. Open Excel and copy vertical rows ... Launch Excel and open the workbook that has your dataset in it. Select the cells...
Read more >
Change Horizontal Data to Vertical - Excel TRANSPOSE ...
I want 4 rows and 2 columns. With those cells selected, I type =TRANSPOSE, open bracket, and then the cells from the original...
Read more >
Reading horizontal (row-based) data from xlsx files into R ...
Thanks a lot for the effort! I think we found a great way based on type.convert - really a neat little helper function!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found