pyexcel-ods3 icon indicating copy to clipboard operation
pyexcel-ods3 copied to clipboard

Appending a line to a ods table without changing the rest

Open hajohoetger opened this issue 1 year ago • 0 comments

Hi, i'm not too confident to get the solution to my problem, but you'll never know if you don't try.

I have a table containing measured values. Column A contains a timestamp and Col B the measured value. Columns C to F contain various calculations as function of the measured values in Col B.

I want to append a new measurement periodically by script without changing the formulars in Col C-F. Currently i managed to append only by reading the file, appending the line and writing it back.

Like this: ''' #!/home/hajo/venvs/pyexcel-ods3/bin/python import datetime from pyexcel_ods3 import get_data from pyexcel_ods3 import save_data

price = float(input("How much is the fish?\n: ")) data = get_data("fishprice.ods") data["2024"].append([datetime.datetime.now(), price]) save_data("fishprice.ods", data) '''

This script overwrites all the formulars in Col C-F with the respectively calculated values. But i want to keep the formulars and have only the timestamp and new measurement appended. Is this possible? Best regards HaJo

hajohoetger avatar Sep 21 '24 14:09 hajohoetger