title: Parse only specific columns from csv file using token
body: <p>If I have a file filled with comma separated values, such as this:</p>
  
  <pre><code>"myComputer",5,192.168.1.0,25
  "herComputer",6,192.168.1.1,26
  "hisComputer",7,192.168.1.2,27
  </code></pre>
  
  <p>And I want to pull the data out as a string, I would do something like this:</p>
  
  <pre><code>std::string line;
  std::ifstream myfile ("myCSVFile.txt");
  
  if(myfile.is_open())
  {
      while(getline(myfile,line))
      {
          std::string tempString = line;
          std::string delimiter = ",";
      }
  }
  </code></pre>
  
  <p>In order to parse out each value by itself, I use something like this: <a href="https://stackoverflow.com/questions/14265581/parse-split-a-string-in-c-using-string-delimiter-standard-c">Parse (split) a string in C++ using string delimiter (standard C++)</a></p>
  
  <pre><code>std::string s = "scott&gt;=tiger&gt;=mushroom";
  std::string delimiter = "&gt;=";
  
  size_t pos = 0;
  std::string token;
  while ((pos = s.find(delimiter)) != std::string::npos) {
      token = s.substr(0, pos);
      std::cout &lt;&lt; token &lt;&lt; std::endl;
      s.erase(0, pos + delimiter.length());
  }
  std::cout &lt;&lt; s &lt;&lt; std::endl;
  </code></pre>
  
  <p>The question is, what if I only want, the first and third value?  So if I wanted my csv file from above, to only output</p>
  
  <pre><code>"myComputer" 192.168.1.0
  "herComputer" 192.168.1.1
  "hisComputer" 192.168.1.2
  </code></pre>
  
  <p>Is there a way to achieve this using the methods above, or should I use a completely different method?  Thanks,</p>