Hello all,
I have been searching these threads for a script to format a names list i have in a text file. The names are formatted as
Last Name, First Name
What I wold like is
First Name Last Name
I found this script on another forum and tried to adapt it to my situation to no avail:
Dim FSO, objFile, RegEx, strDestin, strFile, strSource
Set FSO = CreateObject("Scripting.FileSystemObject")
Set RegEx = New RegExp
RegEx.Global = True
RegEx.Pattern = "^([^,]*), (.*)$"
Const ForReading = 1
strSource = "c:\testfile.txt"
strDestin = "c:\newfile.txt"
Set objFile = FSO.OpenTextFile(strSource, ForReading)
strFile = objFile.ReadAll
objFile.Close
strFile = RegEx.Replace(strFile, "$2 $1")
Set objFile = FSO.CreateTextFile(strDestin, True)
objFile.Write strFile
objFile.Close
Any help would be most appreciated.
TIA,
AL
I have been searching these threads for a script to format a names list i have in a text file. The names are formatted as
Last Name, First Name
What I wold like is
First Name Last Name
I found this script on another forum and tried to adapt it to my situation to no avail:
Dim FSO, objFile, RegEx, strDestin, strFile, strSource
Set FSO = CreateObject("Scripting.FileSystemObject")
Set RegEx = New RegExp
RegEx.Global = True
RegEx.Pattern = "^([^,]*), (.*)$"
Const ForReading = 1
strSource = "c:\testfile.txt"
strDestin = "c:\newfile.txt"
Set objFile = FSO.OpenTextFile(strSource, ForReading)
strFile = objFile.ReadAll
objFile.Close
strFile = RegEx.Replace(strFile, "$2 $1")
Set objFile = FSO.CreateTextFile(strDestin, True)
objFile.Write strFile
objFile.Close
Any help would be most appreciated.
TIA,
AL