June 12, 2007 at 6:03 am
I'm trying to write a ActiveX task that takes a flat file created by a Data Transform and scrubs out all the occurrences of a double double-quote (i.e. "") as well as replacing the string "%%" with " ". I'm getting a "property not supported" error on my first FSO.OpenTextFile statement. I've tried adding "True" as a third operand according to the docs, but that didn't help. Any ideas?
Assuming "fx" points to the input file and "fi" to the output.
set fso=createobject("Scripting.FileSystemObject")
dim inf, outf, dq
Const ForReading = 1, ForWriting = 2
dq=chr(34)&chr(34)
inf=fso.opentextfile(fx,ForReading) <======== Error here.
outf=fso.opentextfile(fi,ForWriting)
dim line
line=inf.readline
while line<>""
while find(line,dq)>0
line=replace(line,dq,"")
wend
while find(line,"%%")>0
line=replace(line,"%%"," ")
wend
outf.writeline line
line=inf.readline
wend
June 13, 2007 at 4:19 am
June 13, 2007 at 5:32 am
One of those stupid things you know but don't see when you're looking at the code.
Thanks.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply