fast_excel
fast_excel copied to clipboard
Make it possible to add column
This is very promising solution to Axlsx, if it would only have the possibility to add columns in the middle of file generation process. We have this process of generating large Excel files, which also need to dynamically add columns, if certain data appears.
How could that be possible to achieve that result?
Hello @marisveide
Yes it's possible, somehow like this:
workbook = FastExcel.open(constant_memory: false) # must be constant_memory: false
worksheet = workbook.add_worksheet("Example Report")
worksheet.write_value(0, 10, "Column 10") # adding new column name
worksheet.write_value(123, 10, "Value 10") # writing value
workbook.read_string # result
When constant_memory: true it will write parts to disk and we can't update rows that already been written.