private void Form1_Load(object sender, EventArgs e)
{
GetDataTable(@"C:\Documents and Settings\agordon\Desktop\ACTIVITYEX.csv");
}
public System.Data.DataTable GetDataTable(string strFileName)
{
System.Data.OleDb.OleDbConnection conn =
new System.Data.OleDb.OleDbConnection
("Provider=Microsoft.Jet.OleDb.4.0; Data Source = "
+ System.IO.Path.GetDirectoryName(strFileName)
+ ";Extended Properties = \"Text;HDR=YES;FMT=TabDelimited\"");
conn.Open();
string strQuery = "SELECT * FROM [" + System.IO.Path.GetFileName(strFileName) + "]";
System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(strQuery, conn);
System.Data.DataTable ds = new System.Data.DataTable("CSV File");
adapter.Fill(ds);
return ds;
}
even though the data is tab delimitted it is writing an enter row into one datapoint. it is not recognizing the tabbing. here is an example of one of the tabs: " "
here is an example of one row that it imported into one single data point:
V2.00 Administrator TX 0002 08:50
04/14/11 0 F 004 H 14400 0000 0000
ok 02 1 biscom-server 4321
Administrator 08:50:31
04/14/2011 08:50:33
04/14/2011 08:50:00
04/14/2011 12ffefe9-fa4f-4b45-8dcb-8ed2a2e28de3 419571 004 YES C:\MerthTesting\XIFINFax\Receive\20110414085022\FAX_8582170332_101169_20110413_13_36.pdf normal BISCOM-SERVER_Dev_1104141550330002
what am i doing wrong? what is the data being scrunched into one data point ?
Someone else had the exact same problem:
http://social.microsoft.com/Forums/en-US/Offtopic/thread/9f7d2b67-cea5-4840-96ef-2e12011752d7