Read txt with delimeter and multiple spaces : <p>I have a text file where the delimiter is '&amp;'. However, the first column is text and may contain spaces as well - How can I properly read it ? The text looks like</p>

<pre><code>selection according to criteria A &amp; 2312
</code></pre>

<p>some other  selection according to criteria B &amp; 345</p>

<p>Please note that the text in first column can contain more than one word (ie more spaces from one to another line). I ve tried something</p>

<pre><code>char ch;
ch="&amp;";
   ifstream filein;
   filein.open("selection.txt");
   while (1) {
      data &gt;&gt; c1 &gt;&gt; char &gt;&gt;c2 ;

        cut1.push_back(c1);
        cut2.push_back(c2);

      if (!data.good()) break;

}
</code></pre>

<p>but this does not work... </p>

<p>thanks in advance</p>
