zdavatz / spreadsheet

The Ruby Spreadsheet by ywesee GmbH
http://spreadsheet.ch
GNU General Public License v3.0
1.13k stars 240 forks source link

Stream spreadsheet rows to file #164

Closed pomartel closed 8 years ago

pomartel commented 8 years ago

It looks like the spreadsheet gem gathers all cells data in memory before outputting to a file. This can be problematic for big Excel files on memory constrained environments like Heroku. I was wondering if there is a way to stream directly to the file as rows are added and then free up that memory? I read in the source code that you can initialize a Workbook with a io object but I'm not sure if that's helpful.

zdavatz commented 8 years ago

You will have to try this by yourself. This may help you as well: https://github.com/zdavatz/spreadsheet/blob/master/Excel97-2007BinaryFileFormatSpecification.pdf https://github.com/zdavatz/spreadsheet/blob/master/excelfileformat.pdf

pomartel commented 8 years ago

Alright! Thanks for the quick answer!

mcclone2001 commented 1 year ago

I know it's an old repo and an old question, but I'm working on some legacy code and having issues creating big files with this library,

@pomartel did you succeed in streaming the rows?