Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Reading comma separated values to and from an array

$
0
0
Hello! I am attempting to use stdio to archive and play back comma separated values to a text file, but I have a few questions. What I'm attempting to do is save data from two different motor controllers (1500 values each ranging from -1.000 to +1.000 taken every 1/100th of a second) into a text file using CSV. Currently I'm not sure if I can either write to two lines or write to two files simultaneously (and efficiently). I'm fairly certain that both are possible and fairly straightforward, but research hasn't yielded much yet. What I would really like to learn how to do is take that data out of the text file(s) and put it into two arrays (all 1500 values in each). I've been attempting to do this using the much more familiar fstream, but as it turns out that doesn't work on imbedded systems (we're programming a National Instruments cRIO-II, which has the same capabilities for interpreting and storing code as a typical computer, except for a few library issues). Could someone explain/demonstrate how this would be done? Thanks!

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>