//VBScript to first remove any " from file.
VBSTART
Sub ReadEntireFile1 'reading file and storing it in ReadFile
Dim fs, f, ReadFile
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("c:\apps\mbmsnet\wanda\in\wanda.txt", 1,0)
ReadFile = f.ReadAll
f.Close
dim result
dim QuoteChar
QuoteChar = chr(34)
result = replace(ReadFile,QuoteChar," ")
Set f = fs.OpenTextFile("c:\apps\mbmsnet\wanda\in\wanda.txt", 2, True)
f.Write result
End Sub
VBEND
VBRun>ReadEntireFile1
How Do I: Find and Replace...
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
It's been a while, but I recently had to visit this problem again. How to replace a double quote in the source file of a vbReplace function. Using a variable does not work on the source file. Eric D provided his final coding, but the solution to replace the quote was really buried in the middle. I have removed the relevant section to be easier to find in the future.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!