title: c++ Skip first line of csv file
body: <p>I got my program to read from a .csv file and output the data but I don't want it to output the first line. I've tried to use <code>getline(data, line);</code> and <code>stream.ignore ( std::numeric_limits&lt;std::streamsize&gt;::max(), '\n' );</code>. While it does skip the first line, the last two lines print twice and are mixed up.</p>
  
  <pre><code>string ID;
  string sentenceIn;
  string servedIn;
  int sentence;
  int served;
  string lastName;
  string firstName;
  
  vector&lt;string&gt; idNum;
  vector&lt;string&gt; sentenceLen;
  vector&lt;string&gt; servedTime;
  vector&lt;string&gt; lastNameIn;
  vector&lt;string&gt; firstNameIn;
  
  
  ifstream data("prisoner_data.csv");
  
  if (data.is_open())
  {
      cout &lt;&lt; "File opened successfully." &lt;&lt; endl &lt;&lt; endl;
      while (data.good()) // !someStream.eof()
      {
          getline(data, ID, ',');
          cout &lt;&lt; ID &lt;&lt; "  ";
          idNum.push_back(ID);
  
          getline(data, sentenceIn, ',');
          cout &lt;&lt; sentenceIn &lt;&lt; "  ";
          sentenceLen.push_back(sentenceIn);
          istringstream(sentenceIn) &gt;&gt; sentence;
  
          getline(data, servedIn, ',');
          cout &lt;&lt; servedIn &lt;&lt; "  ";
          servedTime.push_back(servedIn);
          istringstream(servedIn) &gt;&gt; served;
  
          getline(data, lastName, ',');
          lastNameIn.push_back(lastName);
          cout &lt;&lt; lastName &lt;&lt; "  ";
  
          getline(data, firstName, ',');
          firstNameIn.push_back(firstName);
          cout &lt;&lt; firstName &lt;&lt; "  ";
      }
  }
  </code></pre>
  
  <p>What can I do to skip the first line without messing up the last?</p>