Answer the question
In order to leave comments, you need to log in
What is the best way to form xlsx in php for 10+ million cells?
Phpsreadsheet does a poor job. 4 GB of RAM is already running out of 4 million cells. And the unloading process takes about 30 minutes. Can anyone advise faster libraries or methods?
Answer the question
In order to leave comments, you need to log in
xlsx is a zip archive with xml files, you can create it manually, make a file template so that you do not generate from scratch and it is easier to insert content. but such a volume of data will slow down in any case, even if you convert it to CSV
To make it faster, work with xl/worksheets/sheet?.xml files (inside the zip archive - xlsx file) directly! either as with XML, or as with text search / replace (through regular expressions for example), although ... if this is a clean file from scratch, then it is easier and faster to generate these files from scratch as text, in this file there is data in the sheetData section, see .example:
<sheetData>
<row r="1">
<c r="A1" t="str">
<v>Иванов</v>
</c>
<c r="B1" t="str">
<v>Петров</v>
</c>
<c r="С1" t="str">
<v>Сидоров</v>
</c>
...
</row>
</sheetData>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question