title: How to read a file with multiple delimiters within a single line
body: <p>I am trying to read a file which has multiple delimiters per line.
  Below is the data </p>
  
  <pre><code>2,22:11
  3,33:11
  4,44:11
  5,55:11
  6,66:11
  7,77:11
  8,88:11
  9,99:11
  10,00:11
  11,011:11
  12,022:11
  13,033:11
  14,044:11
  15,055:11
  16,066:11
  17,077:11
  18,088:11
  19,099:11
  </code></pre>
  
  <p>And the code is below</p>
  
  <p>Here, I am trying to read the line first with comma as delimiter to get line and then the colon.</p>
  
  <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  int main() {
    std::string line;
    std::string token;
    std::ifstream infile;
  
    infile.open("./data.txt");
    while (std::getline(infile, line,',')) {
      std::cout &lt;&lt; line &lt;&lt; std::endl;
      while(getline(infile, token, ':'))
      {
        std::cout &lt;&lt; " : " &lt;&lt; token;
      }
    }
  }
  </code></pre>
  
  <p>But there is an issue with the code as it is skipping the first line.
  Also , if i comment the second while loop,only the first line is getting printed, and below is the output</p>
  
  <p>Ian unable to figure out where exactly the code has gone wrong</p>
  
  <p>Output</p>
  
  <pre><code>2
   : 22 : 11
  3,33 : 11
  4,44 : 11
  5,55 : 11
  6,66 : 11
  7,77 : 11
  8,88 : 11
  9,99 : 11
  10,00 : 11
  11,011 : 11
  12,022 : 11
  13,033 : 11
  14,044 : 11
  15,055 : 11
  16,066 : 11
  17,077 : 11
  18,088 : 11
  19,099 : 11
  </code></pre>