Inside this loop we use the ReadLine method to read in the first line (the first name) from the text file, storing that value in the variable. cscriptwscript replace.vbs Find Replacewith File Find Required. To begin with, we set up a Do Until loop that runs until the file’s AtEndOfStream property is True that simply means that we’re going to keep reading the file until there’s nothing left to read. VBScript’s VarType function will return a value indicating the type of variable. This script lets you replace string in a text file using VBS and FSO. This way, when you read a line from VBScript, you will know what kind of data you have. If you don’t know what kind of data is on each line, then consider exporting a data type identifier along with the data from the program that generated the file. NOTE: the above example does have the limitation that you have to know what kind of data is on each line.
0 Comments
Leave a Reply. |