Hello John,
Here is some sample code that should get you started:
DataTable dt = new DataTable();
using (TextReader tr = File.OpenText("TabDelimitedFile.txt"))
{
string line;
while ((line = tr.ReadLine()) != null)
{
string[] items = line.Split('\t');
if (dt.Columns.Count == 0)
{
// Create the data columns for the data table based on the number of items
// on the first line of the file
for (int i = 0; i < items.Length; i++)
dt.Columns.Add(new DataColumn("Column" + i, typeof(string)));
}
dt.Rows.Add(items);
}
}
// Print out all the values
foreach (DataRow dr in dt.Rows)
{
foreach (string s in dr.ItemArray)
Console.Write(s + "\t");
Console.WriteLine();
}
HTH
Wes Haggard
http://weblogs.asp.net/whaggard/