Write CSV file into vectors in C (continued)
<p>Basically I have 14800x8 matrix that has been extracted from matlab as CSV file ("moves.mo"). I need to read this file into 14800 vectors with 8 values each.
Here is a few lines from the file:</p>

<pre><code>1,2,3,4,-1,-3,-2,-4
1,2,3,5,-1,-3,-2,-5
1,2,3,6,-1,-3,-2,-6
1,2,3,7,-1,-3,-2,-7
1,2,3,8,-1,-3,-2,-8
1,2,3,9,-1,-3,-2,-9
</code></pre>

<p>I wrote the following code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include&lt;stdio.h&gt;
#include &lt;string&gt;
#include &lt;istream&gt;
#include &lt;vector&gt;
#include &lt;sstream&gt;
using namespace std;
int main()
{



        std::fstream inputfile;
        inputfile.open("moves.da");
        std::vector&lt; std::vector&lt;int&gt; &gt; vectorsmovesList; //declare vector list


        while (inputfile) {

            std::string s;
            if (!getline( inputfile, s )) break;

            istringstream ss( s );
            vector &lt;int&gt; recordmove;

            while (ss)
            {

                if (!getline( ss, s, ',' )) break;
                int recordedMoveInt = atoi(s.c_str());
                recordmove.push_back( recordedMoveInt );
            }

            vectorsmovesList.push_back( recordmove );
        }
        if (!inputfile.eof())
        {
            cerr &lt;&lt; "Fooey!\n";
        }
</code></pre>

<p>It compiles but does not give me desirable output (i.e. just prints Fooey!) . I don't know why... This problem at this point is driving me insane. </p>

<p>Please help!</p>
