Community
cancel
Showing results for 
Search instead for 
Did you mean: 
DDang1
Beginner
1,044 Views

How to log data to csv file - Intel Edison?

Hi guys,

I'm using Intel Edison as a server that collects data and then saves the data to a file in SD card. I'm using Node.js. I know that it is possible to save as TXT file.

But is it possible to save the data as CSV format file? Please show me how if it is possible.

Thanks and best regards.

0 Kudos
4 Replies
idata
Community Manager
73 Views

Hi NewMech,

 

 

Thanks for your interest in the Intel® Edison Platform.

 

 

I have not saved data as a CSV format file before, however, I have been investigating how it could be done and I'd suggest you to try to use nodeCSV, it provides CSV generation, parsing, transformation and serialization for Node.js. Please take a look at https://github.com/wdavidw/node-csv# readme NodeCSV for more details.

 

 

Hope you find this information useful.

 

 

Regards,

 

-Yermi A.

 

DDang1
Beginner
73 Views

Hi Yermi A.,

Thanks alot about your help.

I've read what you gave me. It's so complicated for me, so I decided to use JSON instead. But please tell me how can I tell the Edison to save the JSON file on sdcard?

idata
Community Manager
73 Views

Hi NewMech,

 

 

Your welcome, we are here to help you. Regarding your question, you can write your own code to store the JSON file using the file system (fs) module and specifying the path of the SD card that is usually mounted in /media/sdcard. Please take a look at the "Write file" section here: http://en.proft.me/2016/03/20/how-read-and-write-file-nodejs/ How to read and write a file in Node.js.

 

 

Additionally, you can also take a look at these link for extra information:

 

Hope this information helps.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
73 Views

Hi NewMech,

 

 

We would like to know if you still need assistance in this case or if you have any questions.

 

 

Regards,

 

-Yermi A.

 

Reply