title: working with a delimited text file
body: <p>started working on the text file reading- delimited by pipe underscore and pipe - |_| 
  tried the following code.doesn't produce the desired result. 
  the split condition should be modified, but how. please advise. 
  Thanks everyone - this works now.</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          string filePath = @"J:\dot\emp.dat";
  
  
          var query = 
              from line in File.ReadLines(filePath)
              let empRecord = line.Split(new string[] {"|_|"},StringSplitOptions.None)
  
              select new datFile()
              {
                  name = empRecord[0],
                  employeeid = empRecord[1],
                  income = empRecord[2],
                  expenses = empRecord[3]
  
              };
  
          foreach (var item in query)
          {
              Console.WriteLine(item.name, item.employeeid, 
                   item.income, item.expenses);
          }
          Console.ReadLine();
      }
  
      public class datFile
      {
          public string name { get; set; }
          public string employeeid { get; set; }
          public string income { get; set; }
          public string expenses { get; set; }
  
        }
     }
  </code></pre>
  
  <p>File contents:</p>
  
  <pre><code>name|_|employeeid|_|income|_|expenses
  emp1|_|201501|_|100000|_|50000
  emp2|_|20000|_|90000|_|30000
  emp3|_|34234|_|100000|_|23000
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code> name
   emp1
   emp3
   emp3   
   ----- 
  </code></pre>