Jump to content

Replace HTML String


Recommended Posts

Hello All

 

First time posting, long time lurking and learning.

I need to replace some html in multiple files one after the other with some information from an excel spreadsheet

 

for example the HTML file contains this string

Reference:</td><td style="padding: 0px 10px 0px 10px;margin: 2px;font-size: 8pt;">

 

i want to add a value to the end like so

 

Reference:</td><td style="padding: 0px 10px 0px 10px;margin: 2px;font-size: 8pt;">$VISION_ID

but as the string contains " I'm not sure how to work around it

I know the answer will be simple but i just can't figure this one out

 

this is how far i got until i had trouble with the "

 

Sleep (1000)
Local $FromTo = $oWorkbook2.Worksheets(1).Range("B1").Value       
Sleep (1000)
Local $sFind = "Reference:</td><td style="padding: 0px 10px 0px 10px;margin: 2px;font-size: 8pt;">"
Local $sReplace = $FromTo
Local $sFilename = "C:\extract\Daily_import.html"
Local $iRetval = _ReplaceStringInFile($sFilename, $sFind, $sReplace)
Sleep (1000)

 

 

 

Thanks in advance

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...