Hi Im using Visual Basic 2008 Express Edition, my goal is to read an entire .txt file that works as a template and replace all ocurances of a word with a new one and save th
Dim fileReader As String = My.Computer.FileSystem.ReadAllText("C:\test.txt").Replace("foo", "bar")
My.Computer.FileSystem.WriteAllText("C:\test2.txt", fileReader, False)
So you should use the ReadAllText method of the FileSystem, pass the path as parameter and use the Replace method to replace what you want to replace. For more advanced usages of replace you can use regular expressions. You can read about that here.
Shorter version:
My.Computer.FileSystem.WriteAllText("C:\test2.txt", My.Computer.FileSystem.ReadAllText("C:\test.txt").Replace("foo", "bar"), False)