My React Native app (on android only) is a basic app that will collect some sensors data when users start recording video. I have three arrays of sensors data: accelerometer, gyroscope, and light. I want to save them to the device as .csv
files so I can use them for the next steps. Currently, I can save them in .txt
(using react-native-fs, but they do not support .csv
extension) but what I want is .csv
. Is there any way to do that in React Native?
Data will look like this:
this.accelerometer = [
{x: 12, y: 15, z: 17},
{x: 12, y: 15, z: 17},
...
{x: 12, y: 15, z: 17},
]
this.gyroscope = [
{x: 12, y: 15, z: 17},
{x: 12, y: 15, z: 17},
...
{x: 12, y: 15, z: 17},
]
this.light = [6, 7, 8, 9, 10,.., 11]
Desired .csv
, for example accelerometer.csv
:
x ,y ,z
12,15,17