title: good way for reading a delimited file into DataTable
body: <p>i was looking for good way to read a delimited file into DataTable and found this piece of code.</p>
  
  <pre><code>    private void txtRead_Click(object sender, EventArgs e)
      {
          var filename = @"d:\shiptest.txt";
          var reader = ReadAsLines(filename);
  
          var data = new DataTable();
  
          //this assume the first record is filled with the column names
          var headers = reader.First().Split('\t');
          foreach (var header in headers)
          {
              data.Columns.Add(header);
          }
  
          var records = reader.Skip(1);
          foreach (var record in records)
          {
              data.Rows.Add(record.Split('\t'));
          }
  
          dgList.DataSource=data;
      }
  
      static IEnumerable&lt;string&gt; ReadAsLines(string filename)
      {
          using (var reader = new StreamReader(filename))
              while (!reader.EndOfStream)
                  yield return reader.ReadLine();
      }
  </code></pre>
  
  <p>this code works fine and fast but i am curious about that what would be the efficiency of the above code when there will be huge data in text file.looking for suggestion. thanks</p>