Parse by columns instead of rows #335

Open
opened 2015-12-17 13:49:50 +00:00 by DaAwesomeP · 1 comment
DaAwesomeP commented 2015-12-17 13:49:50 +00:00 (Migrated from github.com)

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 2017-02-21 09:11:26 +00:00 (Migrated from github.com)

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 Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#335
No description provided.