title: 'System.OutOfMemoryException' when using ReadAllText() method
body: <p>I have a tab delimited file with 8,000,000+ rows that have some rogue tabs.</p>
  
  <p>For example:</p>
  
  <pre><code>a-&gt;b-&gt;c-&gt;d
  a-&gt;b-&gt;c-&gt;--&gt;--&gt;--d
  a-&gt;b-&gt;c-&gt;d
  a-&gt;b-&gt;c-&gt;d
  </code></pre>
  
  <p>I have a method to rectify the rogue tabs (3 tabs to 1 tab) as follows:</p>
  
  <pre><code>string text = File.ReadAllText(filePath);
  text = text.Replace("\t\t\t", "\t");
  File.WriteAllText(filePath, text);
  </code></pre>
  
  <p>The above code block produces the following error:</p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.OutOfMemoryException' occurred
    in mscorlib.dll</p>
  </blockquote>
  
  <p>How can I read and and write just one row at a time so that the whole file is not in memory?</p>