excelize icon indicating copy to clipboard operation
excelize copied to clipboard

Support streaming writer on existing sheets

Open GuchiGangz opened this issue 3 months ago • 4 comments

Description

Hello 👋

Currently, NewStreamWriter in Excelize only supports creating a new sheet for streaming writes. This is very useful for large datasets because of the reduced memory usage.

However, in many real-world use cases, we need to append or modify data on an existing sheet without loading the entire workbook into memory. For example:

  • Adding new rows to an existing data sheet with headers already defined.

Currently, the old data in the Sheet will be disappear only new StreamData will be append into it

👉 Feature Request: Enable NewStreamWriter to work on an existing sheet so we can stream data into it directly (append or write new rows) without recreating sheets.

This would make Excelize even more powerful for handling large files with pre-existing templates.

Additional context

No response

Validations

  • [x] Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.

GuchiGangz avatar Sep 09 '25 07:09 GuchiGangz

Thanks for your issue. There is no plan to add this support in the short term.

xuri avatar Sep 09 '25 07:09 xuri

To address this, we can export the XML data from the file. Except for a few critical data components like SheetData, most of the original template data will be cached. With this approach, it is entirely feasible to extract the original data and re-implement streaming writing to the existing worksheet—allowing us to append or modify data without reloading the entire workbook or recreating the worksheet.

fuyilin031011-svg avatar Sep 16 '25 07:09 fuyilin031011-svg

Read existing sheet and streaming write it to a new sheet

g-mero avatar Oct 30 '25 03:10 g-mero

Read existing sheet and streaming write it to a new sheet

Thanks man i will try

hieubt1-uniultra avatar Oct 30 '25 07:10 hieubt1-uniultra