Hanko Posted April 23, 2016 Share Posted April 23, 2016 Vb read line, 5 characters to the left, copy rest of text in the line, display and continue to next line I have a text file on c, i need to open and read the first line, verify if the 5 characters are = to some other text, if yes, display the REST of the text in the line, then repeat for each line on the file.txt until it reads all the lines in the text file. not sure how to do it...What I have tried:My "code"Dim fileReader As StreamReader fileReader = My.Computer.FileSystem.OpenTextFileReader("C:\locatin1/filetoshow.txt")Dim stringReader As StringstringReader = fileReader.ReadLine()''if readline last end if not continue to next line....'' read first 6 characters and do if' If stringReader = ""Dis1err" Then'Display1.Dis1RTB1.Text = "display the items to the right after character 6 to endofline"'Else' If stringReader = ""Dis1jam" Then'Display1.Dis1RTB2.Text = "display the items to the right after character 6 to endofline"'Else' If stringReader = ""Dis1???" Then'Display1.Dis1RTB3.Text = "display the items to the right after character 6 to endofline"'Else' If stringReader = ""Dis2err" Then'Display2.Dis2RTB1.Text = "display the items to the right after character 6 to endofline"'Else' If stringReader = ""Dis2jam" Then'Display2.Dis2RTB2.Text = "display the items to the right after character 6 to endofline"'Else' If stringReader = ""Dis2???" Then'Display2.Dis1RTB3.Text = "display the items to the right after character 6 to endofline"'Else'stringReader.Close() Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now