Here is how I do this in VBScript. You can do similar in .NET
It works, it will read txt and csv files just like a database. You can query
it.
set conn=CreateObject("adodb.connection")
conn.Open "DRIVER={Microsoft Text Driver (*.txt;
*.csv)};DefaultDir=/WorkingDir;"
set rs=CreateObject("adodb.recordset")
strSQL = "SELECT * FROM [MyFileName.csv] "
rs.Open strSQL, conn, 3, 3
if not rs.EOF then
do while not rs.EOF
'Do what you need to do with the data.
rs.movenext
loop
end if
'Close your connection and recordset
This is in VBScript. I have not done it yet it .NET though that will be
trivial. It will save all the effort of parsing the file to get what you
want. You can set up the ODBC parameters to however the data should be
parsed (delimited).
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available