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.

Future support of reading first columns along/instead of first rows?

See original GitHub issue

Hello! I currently extract first row and column of my worksheet by parsing through the cells, but I would like to limit the file reading so only needed data (first column and/or row) is extracted. I already know about using XLSX.read(myFile, { sheetRows: 1 });, but I didn’t find any issue discussing a column variant sheetColumns. Is such a feature planned for later? Or not at all? Thanks for your time! 😃

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SheetJSDevcommented, Jan 12, 2022

It’s definitely interesting but lower priority. Some notes:

Most file formats store data in row-major order. For example, in the CSV format:

A1,B1,C1,D1,...
A2,B2,C2,D2,...
A3,B3,C3,D3,...
A4,B4,C4,D4,...
...
A1000000,B1000000,C1000000,D1000000,...

The file starts with the first row of data, followed by the second row, followed by the third row, etc. For sheetRows: 1, the parser can stop after the end of the first row.

To extract the data from the first column, the parser would have to scan almost the entire file (stopping at cell B1000000 in the last row)

.

The dual sheetCols parameter is interesting because some formats are column-major order. The XLS file from issue #2432 is in column-major order. BIFF8 XLS also has optional special records that let you jump around the file. This approach would not work for XLSB or XLSX.

0reactions
reviewhercommented, Mar 9, 2022

drop a comment in #475 that a column limit feature should also be supported

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parse by columns instead of rows · Issue #335 - GitHub
Hi, I have a spreadsheet in which the headers are in the left-most column and the ... Future support of reading first columns...
Read more >
Specify number of columns to read when first row is missing ...
I have data from a logger that inserts timestamps as rows within the comma separated data. I've sorted out a way to wrangle...
Read more >
Freeze panes to lock rows and columns - Microsoft Support
Select View > Freeze Panes > Freeze First Column. The faint line that appears between Column A and B shows that the first...
Read more >
Excel: Insuring that row headers read properly for NVDA (like ...
cell A1 (the start of the first row) to "Title". NVDA reads the column headers in the same spreadsheet, but it does not...
Read more >
R: Fast and friendly file finagler - index.utf8.md
For each column sep2 can be different and is the first character in the ... Unlike read.table , it doesn't help speed to...
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