Howlingmad
IS-IT--Management
Can some one help me? Im using VBscript to remove a Character from a Text file (see below script). The problem i have is that when the character is removed the line it was on remains, which mean there is a gap in the text. Is there anyway i can remove then empty line?
Const ForReading = 1
Const ForWritting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutputFile = objFSO.CreateTextFile("C:\Tolisbon\output.txt")
Set objTextFile = objFSO.OpenTextFile("c:\emigrants\btd04.dat", ForReading)
strText = objTextFile.ReadAll
strText = Replace(strText, "", "")
objTextFile.Close
objOutputFile.WriteLine strText
Set objTextFile = objFSO.OpenTextFile("C:\Tolisbon\btd04.txt ", ForReading)
strText = objTextFile.ReadAll
objTextFile.Close
objOutputFile.WriteLine strText
objOutputFile.Close
Const ForReading = 1
Const ForWritting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutputFile = objFSO.CreateTextFile("C:\Tolisbon\output.txt")
Set objTextFile = objFSO.OpenTextFile("c:\emigrants\btd04.dat", ForReading)
strText = objTextFile.ReadAll
strText = Replace(strText, "", "")
objTextFile.Close
objOutputFile.WriteLine strText
Set objTextFile = objFSO.OpenTextFile("C:\Tolisbon\btd04.txt ", ForReading)
strText = objTextFile.ReadAll
objTextFile.Close
objOutputFile.WriteLine strText
objOutputFile.Close