how do you search text files for certain text and read that line only
thanks
trains
Printable View
how do you search text files for certain text and read that line only
thanks
trains
I don't know how you can search a text file without reading it. ;-) If the file is small, I would probably read the file into a string variable and use the Split function to turn it into a string array, then loop through the array looking for the line I want. If it's too large to load all at once, you can read the file one line at a time and stop when I find the text I'm looking for.
Hi you can find a java implementation of what you want at the following link, the idea as phil has mentioned is to read each line one by one and compare the data with your search criterial.
It should be easy to transfer the code to vb.net. Well hopefullyhttp://www.cy2online.net/Downloads.p...ation#Download