read text file

C

CSharpGuy

I have a text file that is formatted as such:

1234568970 BMW
12/12/2004 Smith 25,000 450.25
9876543210 Lexus
01/01/2006 Jones 65,252 750.00
3256232632 Lexus
10/10/2006 Murray 125,110 775.00

----------------------------------------------------------
1234568970 BMW
12/12/2004 Smith 25,000 450.25
9876543210 Lexus
01/01/2006 Jones 65,252 750.00
3256232632 Lexus
10/10/2006 Murray 125,110 775.00


and continues for about 100 lines or so. I need to read this text file and
load it into a table. I'm using streamReader.Readline() but that is only
returning me the first 20 or so depending how many lines there are before
the '----'. how can I read this text file and get all the records before and
after the '------'? I have that spacer in the file several times,its added
when the text file is created by another source.
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top