Read Tab dilimeted file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a excel file, also saved as tab delimited file. Now this tab
delimited file has text(as table) for eg

date empid empsal

10/01/2007 1 20000

now i want to read this table from txt file into a dataset.
How can I do that.

Thanks
 
Hi,
I have a excel file, also saved as tab delimited file. Now this tab
delimited file has text(as table) for eg

date empid empsal

10/01/2007 1 20000

now i want to read this table from txt file into a dataset.
How can I do that.

You'll want to look at methods such as StreamReader.ReadLine(),
String.Split(), and the Parse() method (and related) on the various
types you'll want to generate (such as DateTime and Int32).

Pete
 
An alternate method would be to use the Microsoft Text Driver with the
OdbcConnection & OdbcDataAdapter to open the file as though it were a
database and simply fill the data set directly.
 
Or, one could use the Jet provider and the OleDb data providers:

http://msdn2.microsoft.com/en-us/library/ms974559.aspx


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Andrew Faust said:
An alternate method would be to use the Microsoft Text Driver with the
OdbcConnection & OdbcDataAdapter to open the file as though it were a
database and simply fill the data set directly.

--
Andrew Faust
andrew[at]andrewfaust.com
http://www.andrewfaust.com


Peter Duniho said:
You'll want to look at methods such as StreamReader.ReadLine(),
String.Split(), and the Parse() method (and related) on the various types
you'll want to generate (such as DateTime and Int32).

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top