Set fso = CreateObject("Scripting.FileSystemObject")
Set oldFile = fso.OpenTextFile("c:\temp\oldfile.txt")
Set newFile = fso.CreateTextFile("c:\temp\newfile.txt", True)
strData = oldFile.ReadAll
strData = Replace(strData, vbCRLF, "")
strData = Replace(strData, "^", vbCRLF)
newFile.Write strData
oldFile.Close
newFile.Close
Set oldFile = Nothing
Set newFile = Nothing
|