Hello. I am writing code in Lua using the luacom library. I need to fill out a document with data using a template. I am attaching an example template.
TestT.ods (10.3 KB)
At the moment I am doing everything according to the following algorithm:
-
Filling in the column headings (line 3). Everything is fine here.
-
I find a line containing the value %table%. This means that what follows is the data for the table.
-
I copy the data line the required number of times.
-
I insert data into the resulting rows.
It works, but is very slow. If there are 100 or more lines, the whole process takes a lot of time.
Is there a way to create a range in advance with the required number of rows and insert them in one step?
Can you show me an example of this?
P.S. It is not necessary to give an example in Lua, Python will suit me, I can translate it.