24.11.2020, 09:16
Try this:
Code:
<?
require('apps')
-- set headers for csv file download
setdlheader('text/csv; charset=utf-8', 'Consumption', 'csv')
-- generate csv here
value=grp.tag("consumption")
a={}
for index, id in ipairs(value) do
name=id["name"]
meter=id["data"]
consumption=name .."," .. meter
a[index]=consumi
end
print(a)