<?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 Re: Replace more than one space with ^n in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653127#M196169</link>
    <description>&lt;P&gt;Small update if I may, to cover leading and trailing spaces:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data OBJ1;
  OBJECTIVES='   sample1  2 3 4    5          6   ';
  new=prxchange('s/(^|\b)\s{2,}(\b|$)/^n/oi',-1,OBJECTIVES);
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2020 09:22:38 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2020-06-04T09:22:38Z</dc:date>
    <item>
      <title>Replace more than one space with ^n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653110#M196157</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to replace &lt;U&gt;&lt;STRONG&gt;more than one&lt;/STRONG&gt;&lt;/U&gt; space by ^n,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But my code doesn't work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data OBJ1;&lt;/P&gt;
&lt;P&gt;set OBJ2;&lt;/P&gt;
&lt;P&gt;rx = prxparse('s/(\w+ \w*) +.*/^n/');&lt;BR /&gt;call prxchange(rx,-1,OBJECTIVES);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know please some options to replace &lt;STRONG&gt;&lt;U&gt;more&lt;/U&gt;&lt;/STRONG&gt; than two spaces?&lt;/P&gt;
&lt;P&gt;Thank you for your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Marie&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 08:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653110#M196157</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-06-04T08:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Replace more than one space with ^n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653113#M196159</link>
      <description>&lt;P&gt;Please try the below code , in the example below in objectives variable we have sample1 followed by two spaces number 2 and then number 3 with one space and it replaced only the two spaces between 1 and 2 with ^n&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data OBJ1;
OBJECTIVES='sample1  2 3 4  5  6';
new=prxchange('s/\b\s{2,}\b/^n/oi',-1,OBJECTIVES);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jun 2020 08:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653113#M196159</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-06-04T08:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace more than one space with ^n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653127#M196169</link>
      <description>&lt;P&gt;Small update if I may, to cover leading and trailing spaces:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data OBJ1;
  OBJECTIVES='   sample1  2 3 4    5          6   ';
  new=prxchange('s/(^|\b)\s{2,}(\b|$)/^n/oi',-1,OBJECTIVES);
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 09:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653127#M196169</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-06-04T09:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Replace more than one space with ^n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653265#M196224</link>
      <description>&lt;P&gt;What happened to plain old cmpbl (compressible function).&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 15:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653265#M196224</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-06-04T15:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Replace more than one space with ^n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653273#M196228</link>
      <description>Thank you!</description>
      <pubDate>Thu, 04 Jun 2020 15:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-more-than-one-space-with-n/m-p/653273#M196228</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-06-04T15:45:30Z</dc:date>
    </item>
  </channel>
</rss>

