Page 1 of 1
Exporting live .csv file to use in Processing?
Posted: Fri Apr 29, 2016 12:46 pm
by kgil05
Hi there,
I'm currently developing a desktop app that will allow users to have conversations within a data grid. I want to be able to export this data in real tiime to then run in processing to create a live data visualisation. Is this possible? and can someone point me in the right direction?
thanks,
Katy

Re: Exporting live .csv file to use in Processing?
Posted: Fri Apr 29, 2016 1:08 pm
by Klaus
Hi Katy,
1. welcome to the forum!
2. Can you provide a bit more info?
I want to be able to export this data in real time...
Do you mean to write the content of the datagrid to a file right after the user has entered some data into the datagrid?
I guess the datagrid is of type TABLE, right?
Code: Select all
...to then run in processing to create a live data visualisation
Also with Livecode?
Best
Klaus
Re: Exporting live .csv file to use in Processing?
Posted: Fri Apr 29, 2016 1:52 pm
by kgil05
Hi Klaus,
Thanks for getting back to me so fast!
Yes, it's to write the data as the user inputs it into the datagrid, and it's in the style of a form.
The data visualisation will be made in processing so I am wondering if there is a way I can take the inputed datagrid information and use it in Processing as it is being inputted.
thanks,
katy
Re: Exporting live .csv file to use in Processing?
Posted: Fri Apr 29, 2016 2:13 pm
by Klaus
Hi Katy,
the "content" of a datagrid is an ARRAY in form:
...
array[1]["name of column 1"]
array[1]["name of column 2"]
...
array[1]["name of column N"]
...
array[N]["name of column 1"]
array[N]["name of column 2"]
...
array[N]["name of column N"]
...
You get the picture, and you can access it at any time with:
...
put the dgData of grp "your datagrid group here" into tArrayVariable
## Now process tArrayVariable as desired...
...
Is that what you are looking for?
Best
Klaus
Re: Exporting live .csv file to use in Processing?
Posted: Fri Apr 29, 2016 3:36 pm
by dunbarx
Hi.
Klaus has shown you how to use the DG array directly.
Know also that there is a conversion for that data into ordinary form, using the "dgText"
Code: Select all
put the dgText of group "yourDG" into tData
I find, especially when debugging, this is easier to use, and far more native LC functionality can operate on standard data as opposed to array data.
Craig Newman
Re: Exporting live .csv file to use in Processing?
Posted: Fri Apr 29, 2016 4:03 pm
by Klaus
Yes, sure, but that will break as soon as you have multi-line fields in the datagrid.
That's why I asked what type of datagrid this is.