?
Solved

Read text file

Posted on 2006-06-10
3
Medium Priority
?
234 Views
Last Modified: 2012-05-05
I need to read the last few lines of a text file that start with today's date and display on a text box. Example, it always start with today's date,  6/10/06(tab)Error log number and error message.
0
Comment
Question by:VBdotnet2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
vadim63 earned 2000 total points
ID: 16877457
  Private Sub ReadFile()

        Dim sr As New System.IO.StreamReader("C:\test.txt")
        Dim Line As String = sr.ReadLine()
        Dim strToday() As String
        TextBox1.Multiline = True

        Do While Line IsNot Nothing
            strToday = Split(Line, vbTab)
            If strToday(0) = Today Then TextBox1.Text += Line & vbCrLf
            Line = sr.ReadLine()
        Loop

    End Sub
0
 

Author Comment

by:VBdotnet2005
ID: 16877477
Great example. Thank you :)
0
 
LVL 10

Expert Comment

by:vadim63
ID: 16877490
You're welcome.
Cheers.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month12 days, 3 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question