Parse by columns instead of rows #335

Open
opened 7 years ago by DaAwesomeP · 1 comments
DaAwesomeP commented 7 years ago (Migrated from github.com)
Owner

Hi,
I have a spreadsheet in which the headers are in the left-most column and the data following it to the right. Is there a way to have it format this way? I also could have it move each cell, but I don't think that that's practical.

Hi, I have a spreadsheet in which the headers are in the left-most column and the data following it to the right. Is there a way to have it format this way? I also could have it move each cell, but I don't think that that's practical.
SheetJSDev commented 6 years ago (Migrated from github.com)
Owner

If you know that in advance, you can copy one of the utility functions like sheet_to_json and flip the order of the loops. The underlying files are always stored in row-major order so the best bet is to read the file normally and change the utility functions to be column-major. For example, in https://github.com/SheetJS/js-xlsx/blob/master/bits/90_utils.js#L68 just change the column loops to row loops and vice versa.

If you know that in advance, you can copy one of the utility functions like `sheet_to_json` and flip the order of the loops. The underlying files are always stored in row-major order so the best bet is to read the file normally and change the utility functions to be column-major. For example, in https://github.com/SheetJS/js-xlsx/blob/master/bits/90_utils.js#L68 just change the column loops to row loops and vice versa.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#335
Loading…
There is no content yet.