title: Uploading Parsing a text file with ASP.NET MVC 3
body: <p>so I'm trying to upload then parse a text file with the following format:</p>
  
  <blockquote>
    <p>Mar 29 19:23:51,667|DEBUG|1&nbsp;&nbsp;&nbsp;&nbsp;|1: Initializing lorem ipsum... <br/>
    Mar 29 19:23:31,682|ERROR|1&nbsp;&nbsp;&nbsp;&nbsp;|1: Lorem.Ipsum.Exception while starting Foo.Bar.Launcher <br/>
    System.Blah.LoremException: Lorem ipsum dolor sit amet, consectetur adipisicing elit... <br/>
    &nbsp;&nbsp;&nbsp;&nbsp;at System.Lorem.Ipsum.Dolor.foo() <br/>
    &nbsp;&nbsp;&nbsp;&nbsp;at System.Lorem.Ipsum.Dolor.foo() <br/>
    ... <br/>
    Mar 30 22:23:23,667|DEBUG|1&nbsp;&nbsp;&nbsp;&nbsp;|1: Initializing lorem ipsum... <br/>
    Apr 02 17:24:17,413|ERROR|4&nbsp;&nbsp;&nbsp;&nbsp;|4: Lorem failed to ipsum... System.DolorException: Object reference not set to an instance of an object.<br />
    &nbsp;&nbsp;&nbsp;&nbsp;at Lorem.Ipsum.Dolor.IpsumDbController..ctor()</p>
  </blockquote>
  
  <p>And the Error class:</p>
  
  <pre><code>public class Error
  {
      public int ID { get; set; }
      public string Date { get; set; }
      public string Description { get; set; }
      public string ErrorType { get; set; }
  }
  </code></pre>
  
  <h1>Where There are Two Errors:</h1>
  
  <h2>Error 1</h2>
  
  <p><strong>Mar 29 19:23:33</strong> - is the Date<br/>
  <strong>System.Blah.LoremException</strong> - is the ErrorType. <br/>
  <strong>Lorem ipsum dolor sit amet, consectetur adipisicing elit</strong> - is the Description<br/></p>
  
  <h2>Error 2</h2>
  
  <p><strong>Apr 02 17:24:17</strong> - is the Date<br/>
  <strong>System.DolorException</strong> - is the ErrorType. <br/>
  <strong>Object reference not set to an instance of an object.</strong> - is the Description<br/>
  <br />
  Is there an easy way I can parse the string (through regex? or not?)? I was thinking of splitting the string if it contains ERROR, then getting the next line to assign to ErrorType.</p>
  
  <p>I'm not quite sure how I would go with this, so any help will be appreciated!</p>
  
  <p><strong>UPDATE :</strong> The pattern is really inconsistent, so I'm not really confident with the String.Split solution.</p>
  
  <p>The general rule is:</p>
  
  <p>All |ERROR| will have a Date <strong>(our string Date)</strong>, System.blah.LoremException <strong>(our ErrorType)</strong> followed by an Exception message <strong>(our Description)</strong></p>
  
  <p>The ErrorType &amp; Description could possibly be inline with the ERROR string or on the next line.</p>