Question I'm trying to view the content of a certain column and row of a textfile

fenhopi

Member
Joined
Jul 8, 2010
Messages
6
Programming Experience
Beginner
Hi. I've been googling for hours and can't find an answer to this.

I have a program that searches a textfile for whatever I wrote in the textbox. If he finds it I want it to insert into label1 the text that's on the same row as the word I searched for but only the sentence between column 2 and 14 on that row.

Appreciate all help!
 
VB.NET:
For Each line In IO.File.ReadAllLines("file.txt")
    If line.Contains(SearchTextBox.Text) Then
        ResultLabel.Text = line.Substring(2, 14)
        Exit For
    End If
Next
 
Back
Top