Scooby_Doo
Executive Member
- Joined
- Sep 4, 2005
- Messages
- 9,081
Hey all,
I need to create a script that will be called by a report to change some characters into other characters.
This is what i have so far and it works, PS this is VBS. Be gentle i am a coding noob.
Const ForReading1 = 1
Const ForWriting2 = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Text.txt", ForReading1)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "**123**", "{")
Set objFile = objFSO.OpenTextFile("C:\Text.txt", ForWriting2)
objFile.WriteLine strNewText
objFile.Close
Const ForReading3 = 1
Const ForWriting4 = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Text.txt", ForReading3)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "**125**", "}")
Set objFile = objFSO.OpenTextFile("C:\Text.txt", ForWriting4)
objFile.WriteLine strNewText
objFile.Close
In my report I will be using the SHELL command to pass some variables, in particular the file name and path which are created when the report is run. The next step is declaring variables that can accept the variables from the SHELL command.
Would anyone have any idea on how I can go about doing this.
Thanks
I need to create a script that will be called by a report to change some characters into other characters.
This is what i have so far and it works, PS this is VBS. Be gentle i am a coding noob.
Const ForReading1 = 1
Const ForWriting2 = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Text.txt", ForReading1)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "**123**", "{")
Set objFile = objFSO.OpenTextFile("C:\Text.txt", ForWriting2)
objFile.WriteLine strNewText
objFile.Close
Const ForReading3 = 1
Const ForWriting4 = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Text.txt", ForReading3)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "**125**", "}")
Set objFile = objFSO.OpenTextFile("C:\Text.txt", ForWriting4)
objFile.WriteLine strNewText
objFile.Close
In my report I will be using the SHELL command to pass some variables, in particular the file name and path which are created when the report is run. The next step is declaring variables that can accept the variables from the SHELL command.
Would anyone have any idea on how I can go about doing this.
Thanks