tealeg / xlsx

Go library for reading and writing XLSX files.
Other
5.85k stars 819 forks source link

Can you load only the first row of the sheet and not the whole sheet? #718

Closed oneweek20169902 closed 3 years ago

oneweek20169902 commented 3 years ago

I need to read a 100w excel file, which consumes 1.3gb of memory, but my requirement is only to check if the template is correct, not to load the data in the whole sheet, can I read only the first row of the sheet?

tealeg commented 3 years ago

Not using this library, however.. take a step back. An XLSX file is a zipfile full of XML files, it takes a little working out, but most operations of that nature can be done trivially. If you're going to do this kind of thing often, it's probably just worth your time to start poking around in the file. That's how this library started some 12 years ago.

If it's helpful, the format is standardised and you can read about it here: https://www.ecma-international.org/publications-and-standards/standards/ecma-376/