I'm having some problems with one of my scripts. I am taking a text file and is asterisk delimited with different sections delimited with a tilde. there are no carriage returns or line feeds in the file (took care of that with a different script). Now what I would like to do is put a carriage return in front of each tilde. I have a script to do this, but when I execute it, it just fills up the file with a bunch of CRLF's. Here is my code:
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject"
Set ReadFile = fspenTextFile("c:\temporary\ms2.txt", ForReading, TristateFalse)
thisTxt = ReadFile.ReadAll
Readfile.close
replacetxt = replace(thistxt, "~", vbCR & "~", 1, -1, 1)
set WriteFile = fso.CreateTextFile("c:\temporary\msparsed.txt", ForWriting, True)
WriteFile.Write(replacetxt)
WriteFile.Close
Msgbox "Done parsing data"
Any ideas as to what I'm doing wrong??
Thanks in advance,
Chris
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject"
Set ReadFile = fspenTextFile("c:\temporary\ms2.txt", ForReading, TristateFalse)
thisTxt = ReadFile.ReadAll
Readfile.close
replacetxt = replace(thistxt, "~", vbCR & "~", 1, -1, 1)
set WriteFile = fso.CreateTextFile("c:\temporary\msparsed.txt", ForWriting, True)
WriteFile.Write(replacetxt)
WriteFile.Close
Msgbox "Done parsing data"
Any ideas as to what I'm doing wrong??
Thanks in advance,
Chris