View Single Post
  #2 (permalink)  
Old 04-15-2009, 10:50 AM
LeonR LeonR is offline
VB.NET Forum Enthusiast
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Nov 2006
Location: UK
Age: 26
Posts: 54
Reputation: 45
LeonR is on a distinguished programming path ahead
Default

Ok, so basically you want to return the whole line from the original text file if it has a match for the string you searched for?

I would do it like this:-

1.) Read the text file into an array of somekind - or step through one line at a time.
2.) loop through each element and see if it contains your search string.
If it does contain the search string, then append that line onto another array

3.) once all lines have been searched against the search strings, write the array you created to a new file.

Thats what springs to mind. I don't know the code off the top of my head so sorry I can't help anymore.

Last edited by LeonR; 04-15-2009 at 3:49 PM.
Reply With Quote