I have the script below that will remove a character or phrase that is inside the " ". What I would like to do is have it search the folder on all files and remove the character but inside the file, leave the first character alone (skip it) and remove the rest.
' Constants for I/O
Const ForReading = 1
Const ForWriting = 2
' Define folder to search
strBaseDir = "C:\test\"
' Access the folder
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strBaseDir)
' Process each file in the folder
For Each objFile in objFolder.Files
' Read the entire file
strFile = objFile.Path
Set objReader = objFSO.OpenTextFile(strFile, ForReading)
strData = objReader.ReadAll
' Make desired replacements in the file
strData = Replace(strData, " ? ", "")
' Write the updated data back to the file
Set objWriter = objFSO.OpenTextFile(strFile, ForWriting, True)
If the file was a .txt file and had the below data inside it,
this is a test?.
have the new file be
this is a test.