Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse by columns instead of rows #335

Open
DaAwesomeP opened this issue Dec 17, 2015 · 1 comment
Open

Parse by columns instead of rows #335

DaAwesomeP opened this issue Dec 17, 2015 · 1 comment

Comments

@DaAwesomeP
Copy link

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
Copy link
Contributor

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants