You would read the file in say with TextFieldParser class line by line, place the data into a string array then write the data back to the file after finishing looping thru the file.

The replacement happens as you are reading a line that meets critiera to change text. Use IO.File.WriteAllLines to write the array back to disk.