<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Modify string in HTML file in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Modify-string-in-HTML-file/m-p/113227#M4274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are instances where I need to modify some html code in the the files produced by ods html, through sas &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a nice macro &lt;A href="http://www.unc.edu/~slzhu/mysas/sascode/sascode4.html" title="http://www.unc.edu/~slzhu/mysas/sascode/sascode4.html"&gt;Home Page of Dr. Songlin Zhu&lt;/A&gt;&amp;nbsp; but I experience some difficulties using it with strings that contain quotes/double quotes, particularly unbalanced ones&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to adapt it to fit these cases?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Abe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Aug 2013 12:06:16 GMT</pubDate>
    <dc:creator>EzPaste</dc:creator>
    <dc:date>2013-08-16T12:06:16Z</dc:date>
    <item>
      <title>Modify string in HTML file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modify-string-in-HTML-file/m-p/113227#M4274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are instances where I need to modify some html code in the the files produced by ods html, through sas &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a nice macro &lt;A href="http://www.unc.edu/~slzhu/mysas/sascode/sascode4.html" title="http://www.unc.edu/~slzhu/mysas/sascode/sascode4.html"&gt;Home Page of Dr. Songlin Zhu&lt;/A&gt;&amp;nbsp; but I experience some difficulties using it with strings that contain quotes/double quotes, particularly unbalanced ones&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to adapt it to fit these cases?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Abe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 12:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modify-string-in-HTML-file/m-p/113227#M4274</guid>
      <dc:creator>EzPaste</dc:creator>
      <dc:date>2013-08-16T12:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Modify string in HTML file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modify-string-in-HTML-file/m-p/113228#M4275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you provide a more specific example that fails? Just copy like one line with at least one occurence of what you are attempting to replace. At first glance, it looks like %str or %nrstr paired with appropriate use of the following examples that can be found in %nrstr documentation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="6" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR valign="bottom"&gt;&lt;TH align="left" valign="bottom" width="19%"&gt;Notation &lt;/TH&gt;&lt;TH align="left" valign="bottom" width="30%"&gt;Description &lt;/TH&gt;&lt;TH align="left" valign="bottom" width="24%"&gt;Example &lt;/TH&gt;&lt;TH align="left" valign="bottom" width="24%"&gt;Quoted Value Stored &lt;/TH&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="left" valign="top" width="19%"&gt;%' &lt;/TD&gt;&lt;TD align="left" valign="top" width="30%"&gt;unmatched single quotation mark &lt;/TD&gt;&lt;TD align="left" valign="top" width="24%"&gt;&lt;SPAN class="strongMono"&gt;&lt;A name="a001133163"&gt;&lt;/A&gt;%let myvar=%str(a%');&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD align="left" valign="top" width="24%"&gt;&lt;SPAN class="strongMono"&gt;&lt;A name="a001133164"&gt;&lt;/A&gt;a'&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="left" valign="top" width="19%"&gt;%" &lt;/TD&gt;&lt;TD align="left" valign="top" width="30%"&gt;unmatched double quotation mark &lt;/TD&gt;&lt;TD align="left" valign="top" width="24%"&gt;&lt;SPAN class="strongMono"&gt;&lt;A name="a001133165"&gt;&lt;/A&gt;%let myvar=%str(title %"first);&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD align="left" valign="top" width="24%"&gt;&lt;SPAN class="strongMono"&gt;&lt;A name="a001133166"&gt;&lt;/A&gt;title "first&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="left" valign="top" width="19%"&gt;%(&lt;/TD&gt;&lt;TD align="left" valign="top" width="30%"&gt;unmatched open parenthesis&lt;/TD&gt;&lt;TD align="left" valign="top" width="24%"&gt;&lt;SPAN class="strongMono"&gt;&lt;A name="a001133167"&gt;&lt;/A&gt;%let myvar=%str (log%(12);&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD align="left" valign="top" width="24%"&gt;&lt;SPAN class="strongMono"&gt;&lt;A name="a001133168"&gt;&lt;/A&gt;log(12&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="left" valign="top" width="19%"&gt;%)&lt;/TD&gt;&lt;TD align="left" valign="top" width="30%"&gt;unmatched close parenthesis&lt;/TD&gt;&lt;TD align="left" valign="top" width="24%"&gt;&lt;SPAN class="strongMono"&gt;&lt;A name="a001133169"&gt;&lt;/A&gt;%let myvar=%str (345%));&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD align="left" valign="top" width="24%"&gt;&lt;P&gt;&lt;SPAN class="strongMono"&gt;&lt;A name="a001133170"&gt;&lt;/A&gt;345)&lt;/SPAN&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should achieve your desired results without needing to modify the macro defined by Dr Zhu.&lt;/P&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let old_str=%str(Mike said:%"Hey);&lt;/P&gt;&lt;P&gt;%let new_str=%str(Mike whispered:%"Halt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should appropriately prevent the unbalanced quote error when dereferencing old_str/new_str in the macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 12:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modify-string-in-HTML-file/m-p/113228#M4275</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-08-16T12:24:55Z</dc:date>
    </item>
  </channel>
</rss>

