title: How to replace value in CSV file
body: <p>I have CSV file build like this:</p>
  
  <pre><code>1;name;2;5;
  2;diff_name;3;5;
  </code></pre>
  
  <p>And I would like to be able to replace the 5 with 2 before reading the next line.
  So I am reading the file:</p>
  
  <pre><code>file&gt;&gt;number1;
  file.ignore( numeric_limits &lt; streamsize &gt;::max(), ';' );
  file&gt;&gt;data;
  </code></pre>
  
  <p>and so on. And I was trying to write it this way:</p>
  
  <pre><code>long pos = plik.tellp();
  plik.seekp (pos-2);
  plik&lt;&lt;other_number;
  </code></pre>
  
  <p>But it breaks the file. I don't know how but it's not reliable. the pos somehow depends on the file lenght and I can't make it work every time (with different valuse in file) this way. Is there some other way to replace the value here? Is there an easy way?</p>