- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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:
- https://docs.nodejitsu.com/articles/file-system/how-to-write-files-in-nodejs/ https://docs.nodejitsu.com/articles/file-system/how-to-write-files-in-nodejs/
- https://nodejs.org/api/fs.html# fs_fs_write_fd_buffer_offset_length_position_callback https://nodejs.org/api/fs.html# fs_fs_write_fd_buffer_offset_length_position_callback
- http://stackoverflow.com/questions/36856232/write-add-data-in-json-file-using-node-js http://stackoverflow.com/questions/36856232/write-add-data-in-json-file-using-node-js
Hope this information helps.
Regards,
-Yermi A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page