title: How to open a large text file in C#
body: <p>I have a text file that contains about 100000 articles.
  The structure of file is:</p>
  
  <pre>
  .Document ID 42944-YEAR:5
  .Date  03\08\11
  .Cat  political
  Article Content 1
  
  .Document ID 42945-YEAR:5
  .Date  03\08\11
  .Cat  political
  Article Content 2
  </pre>
  
  <p>I want to open this file in c# for processing it line by line.
  I tried this code:</p>
  
  <pre><code>String[] FileLines = File.ReadAllText(
                    TB_SourceFile.Text).Split(Environment.NewLine.ToCharArray()); 
  </code></pre>
  
  <p>But it says: </p>
  
  <blockquote>
    <p>Exception of type
    'System.OutOfMemoryException' was
    thrown.</p>
  </blockquote>
  
  <p>The question is How can I open this file and read it line by line.</p>
  
  <ul>
  <li>File Size: 564 MB (591,886,626 bytes)</li>
  <li>File Encoding: UTF-8</li>
  <li>File contains Unicode characters.</li>
  </ul>