Logic Machine Forum
collect data in array an save in cv file - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: collect data in array an save in cv file (/showthread.php?tid=4738)



collect data in array an save in cv file - mellotron - 27.04.2023

hi, 
i want to have how to write lua script to collect data in array an save it on csv file with time and date file.

Code:
os.execute('mkdir -p /home/ftp/Rapport_SatCl/Jour')
---------------writing to file--------------------------------
local pile = io.open('/home/ftp/Rapport_SatCl/Jour/Rapport_CuSt_Jour_'..os.date('%d%B%Y')..'.csv',"a")
pile:write('\n')
for i =0 ,4 do
  pile.write(arr_for_Session[i])
  pile.write(';')
end
for j =0,5 do
   pile:write(arr_avis [j])
   pile:write(';')
end
for k=0,7 do
  pile:write(arr_avis[k])
   pile:write(';')
end
pile:write(text)
pile:write('\n')



RE: collect data in array an save in cv file - RomansP - 27.04.2023

Hi mellotron!

I would like to ask you - what kind of data do you want to store and where data comes from?


RE: collect data in array an save in cv file - mellotron - 27.04.2023

(27.04.2023, 08:50)RomansP Wrote: Hi mellotron!

I would like to ask you - what kind of data do you want to store and where data comes from?

hello Roman, i want to store binari value


RE: collect data in array an save in cv file - admin - 27.04.2023

What kind of a binary value? Is it a single object value or multiple objects?


RE: collect data in array an save in cv file - mellotron - 27.04.2023

(27.04.2023, 09:07)admin Wrote: What kind of a binary value? Is it a single object value or multiple objects?

it is multiple object value

(27.04.2023, 09:07)admin Wrote: What kind of a binary value? Is it a single object value or multiple objects?


in fact I made a series of questions that the user must answer and for this fact, I realized a visualization constitutes 4 pages and on each page there are 5 on/off button, I would like to be able to collect these data for a given session.


RE: collect data in array an save in cv file - admin - 27.04.2023

You can create a separate .lp/HTML page and include it via iframe into visualization. See docs here for more info: https://forum.logicmachine.net/showthread.php?tid=85