Reading a text file


Apr 20, 2005
Programming Experience
Hi all,

Hopefully someone can point me in the right direction here. I'm trying to build a simple app which will allow me to look at a text file (I export our monthly sales to a txt file and I want to be able to look at it line by line and search for sales by product group - how many widgits this month, how many fluggles this month etc.) so I can present for others. I could use a spreadsheet for it but I want to give this app to sales people so they can see at a glance.

Is there a pointer to code etc. somewhere which will search each line? I have the front end built and it will the file but need it to look at it line by line and report in a new window.

Any help, much appreciated.


You might want to try to use a StreamReader. The StreamReader has a method ReadLine, which will get the next line into a System.String.

If you use a text file, then you have to go line by line though. You can't search and jump to a specific line.