I have a simple VBScript that looks for a file called test.txt replaces the "|" with a "," and names the file test2.txt.
What I want to do is have the script look at any .txt files in the current directory, create the outputfile in a different directory and name it "ProcessedFile" with a datestamp.
Here is what i have done thus far.
InputFilePath = "test.txt"
OutputFilePath = "Test2.txt"
ForReading = 1
Set FSO = CreateObject("Scripting.FileSystemObject")
Set OutputFile = FSO.CreateTextFile(OutputFilePath,False)
Set InputFile = FSO.GetFile(InputFilePath)
Set InputStream = InputFile.OpenAsTextStream(ForReading)
Total = 0
Do While Not InputStream.AtEndOfStream
Line = InputStream.ReadLine
Line = Replace(Line, "|", ",")
OutputFile.WriteLine(Line)
Total = Total + 1
Loop
msgbox "Total Lines Processed: " & Total
InputStream.Close
OutputFile.Close
Any help would be greatly appreciated.
What I want to do is have the script look at any .txt files in the current directory, create the outputfile in a different directory and name it "ProcessedFile" with a datestamp.
Here is what i have done thus far.
InputFilePath = "test.txt"
OutputFilePath = "Test2.txt"
ForReading = 1
Set FSO = CreateObject("Scripting.FileSystemObject")
Set OutputFile = FSO.CreateTextFile(OutputFilePath,False)
Set InputFile = FSO.GetFile(InputFilePath)
Set InputStream = InputFile.OpenAsTextStream(ForReading)
Total = 0
Do While Not InputStream.AtEndOfStream
Line = InputStream.ReadLine
Line = Replace(Line, "|", ",")
OutputFile.WriteLine(Line)
Total = Total + 1
Loop
msgbox "Total Lines Processed: " & Total
InputStream.Close
OutputFile.Close
Any help would be greatly appreciated.