Dim fso, inputFile, outputFile
Dim str As String
fso = CreateObject("Scripting.FileSystemObject")
'1 means for reading
inputFile = fso.OpenTextFile("c:\testfile.txt", 1)
str = inputFile.ReadAll
'modify this string, replace required characters
str = Replace(str, "whatToReplace", "replaceWithThis")
'write back
outputFile = fso.CreateTextFile("c:\testfile.txt", True)
outputFile.Write(str)
--
Ilyan Mishiyev
IGM Consulting Corporation
Enterprise Web Solutions
www.igmcc.com
"Mark" <Ma**@discussions.microsoft.com> wrote in message
news:25**********************************@microsof t.com...
Hello,
Can anyone help me on how to find and replace text within a .txt file
using
vb.net?
Any help would be greatly appreciated!
Thanks in advance.