Hi I wonder if I can as some advice/get some assistance please...
i have a script which runs through a folder of 1000's of static html pages, looks for a specific piece of data and then changes it (after some subsequent work) to another value..
its actually a <a or <src link to a graphic file, however the url contains a dynamically generate GUID...
Anyway it all works perfectly finding and replacing the data as required bar in one set of circumstances and I just cant fund anything (so far) that may help.
As the html code is compressed a "line" may actually contain multiple links and my script only processes the 1st occurrence..
So Im after some pointers as to how to check whether the line I'm processing has mukltiple "xxxx/yyyy/z" strings and then update each one...
Cheers
i have a script which runs through a folder of 1000's of static html pages, looks for a specific piece of data and then changes it (after some subsequent work) to another value..
its actually a <a or <src link to a graphic file, however the url contains a dynamically generate GUID...
Anyway it all works perfectly finding and replacing the data as required bar in one set of circumstances and I just cant fund anything (so far) that may help.
As the html code is compressed a "line" may actually contain multiple links and my script only processes the 1st occurrence..
Code:
do while oInfile.AtEndOfStream <> True
stLine = oInfile.readline
a1=CINT(InStr(1,stLine,"/xx/yyyyyyyyy/z",VbTextCompare))
' If Image link found find end of GUID
if a1 > 0 then
b1=CINT(InStr(a1+15,stLine,"/"))
c1=CINT((b1-a1)-12)
d1=Mid(stLine,a1+13,c1)
' next check if link contains an param value
e1=CINT(InStr(1,stLine,"param="))
' If found extract all params to end of EndOfTag
if e1 > 0 then
'Found a continuation parameter so look for EndOfTagas end of string
f1=CINT(InStr(e1+1,stLine,"EndOfTag=True"))
g1=Mid(stLine,e1-1,f1-e1+13)
else
' otherwise do nothing
g1=""
end if
So Im after some pointers as to how to check whether the line I'm processing has mukltiple "xxxx/yyyy/z" strings and then update each one...
Cheers