-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Only first sheet is returning when working with Huge data sets #563
Comments
var XLSX = require('xlsx')
var wb = XLSX.readFile('test.xlsx');
var name_of_third_worksheet = wb.SheetNames[3-1]; // SheetNames is an array of strings
var ws = wb.Sheets[name_of_third_worksheet];
var output = XLSX.utils.sheet_to_row_object_array(ws); The browser demo iterates across the sheet names in a similar manner: workbook.SheetNames.forEach(function(sheetName) {
var roa = X.utils.sheet_to_row_object_array(workbook.Sheets[sheetName]);
if(roa.length > 0){
result[sheetName] = roa;
}
}); If you have an example file where you can read one worksheet but not another, then there's probably a parsing issue with that specific sheet. If you could send us a sample, we'd be glad to take a look. Alternatively, if you can enable dev mode (set the option |
@reviewher Thanks for the quick reply. continue with my above reply... Actually, the problem is with. Just to mention there are no errors in the sheet. And there is no special data to share with. Just dummy set of columns and rows are fine to test. One last thing. While doing the testing |
Hi @reviewher, any alternative for this? any help is appreciated. |
@gtd57 what does If you can share a file then we can take a look. If you don't want to upload to github you can email a file to dev at sheetjs dot com and someone can take a look |
As per SheetJS/js-xlsx API, I can send you the data, but its is huge file above 50MB. However, that sheet does not contain any special data, You can create data on your side, I just popped some, one word strings in the first column and first row and rest are just numbers and in total I have used 2000 cols in 1200 rows and total of 3 sheets. My requirement is upto 8 sheets |
Hello @gtd57 ! Just for you I ran a test: https://gist.github.com/SheetJSDev/205d9d9c14c5203e602da70ed57e0a43 It generates an XLSX workbook with 8 sheets. Each sheet happens to be the same but it doesn't affect the nature of the issue. The worksheet is 2000 columns and 1000 rows. You can run it to generate and to verify. On a side note: the files are massive! without compression the generated file was 475MB. With compression it was a more manageable 98M, both well beyond the 50M limit. I tried using the node command line tool to read the data. Turns out you hit a memory snag with the default settings, so you need to override: $ node --max-old-space-size=4096 bin/xlsx.njs sheetjs.xlsx SheetJSA After waiting a minute and 15 seconds, finally saw the CSV output! So if it's only showing you one sheet, I'm guessing there's an issue with the other sheets. I'd like to take a look. If you can post the file to a hosting service like Dropbox, you can email me a link and I can download and take a look. |
I'm getting the same or similar issue. I have a workbook with 7 sheets. |
@mtharrison The limit is dictated by memory, and honestly you would be able to tell in either case when you hit the memory limit (chrome shows "oh snap" and node gives you a long message about GC). Assuming you don't see that, there's something in the file causing trouble. The simplest thing you could do is pass the option
That option will expose any sheet-specific errors. You should get an error message that you can share. I'd like to see a file if you can share it. Since it probably would exceed the github or email limit, please post somewhere (like dropbox) and email or share a link. |
Thanks @SheetJSDev for the super-quick response. I tried with the debug option and the error I get is:
Looks like I'm probably hitting V8's max string size. I logged the buffer size out before |
@mtharrison you caught me in a late night session! If you are running in a recent version of node, can you try calling node with
If you are running something like
|
@mtharrison scratch that. The nodejs string limit is 16 bytes shy of 256MB: nodejs/node#3175 . I thought the previous write test case would cover it, but the underlying xml files are 60M. I'm going to resolve this in the next version by trying to catch that particular error and give more informative output. Can you do one last thing: try saving that file as XLSB in Excel and seeing if you hit the same problem? The XLSB parser keeps data as buffers so it theoretically should not trigger a 256MB string conversion |
@SheetJSDev Using an XLSB does indeed sidestep that issue! Thanks a lot for the help. |
ERROR in src/app/app.component.ts(50,20): error TS2339: Property 'rows' does not exist on type 'HTMLElement'. |
CODE:
} |
Grouping all related reading issues to #61 please follow up there |
While working or bigger data sets( tested with 2000 cols X 1000 rows) with multiple sheets. In that case, after certain MB, (in my case 40MB),
sheet_to_row_object_array
is only returning first sheet.Is it a limitation? Are there any alternatives to get all the sheets regardless of files size?
The text was updated successfully, but these errors were encountered: