In a script I want to save data to a text-file for analysing in excel
The code hereunder works fine.
Code: Select all
file = io.open("/opt/domoticz/userdata/logs/gas.txt", "a+")
file:write(datetimestamp.." gasstand ".."0000.000 ".."0000.000 "..gasstand.." \n")
file:close()
in seperate columns
-[datetimestamp] gasstand
-0000.000
-0000.000
-[value of var gasstand]
So there should be ";" inserted in the saved string. Anybody who can help me hoe to insert in the code that 'column-seperator'
just by inserting ";" or "," generates error
Code: Select all
file:write(datetimestamp.." gasstand "..";".."0000.000 "..";".."0000.000 "..gasstand.." \n")
2023-10-21 14:00:49.410 Error: dzVents: Error: (3.1.8) error loading module 'Gasmeter2' from file '/opt/domoticz/userdata/scripts/dzVents/generated_scripts/Gasmeter2.lua':
2023-10-21 14:00:49.410 ...userdata/scripts/dzVents/generated_scripts/Gasmeter2.lua:26: unfinished string near <eof>
TIA
-Bart