How to replace string after extraction from WebHarvest? -
i wanted insert records had extracted website db, extraction text contained symbol apostrophe, , had caused me syntax error during sql insertion. may know how replace apostrophe "’" instead in webharvest?
thanks in advance!
i use script element work on strings, , output new webharvest variable. example:
<var-def name="r_output"> long string lots of funny characters new lines , & , ' single , " double quotes </var-def> <var-def name="r_output2"> <script return="r_output2"> <![cdata[ string r_output2 = "\n" + r_output.tostring().replaceall("&", "&").replaceall("\\t","").replaceall("\\n","").replaceall("\\r",""); ]]> </script> </var-def> <var name="r_output2"/>
as side note, instead of quoting apostrophes in quotes better quote whole chunk of data eg: "a string ' single quote"
instead of a string "'" single quote
Comments
Post a Comment