<?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: Extract symbol or number from text in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167512#M43384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look into the compress function for starters. Regular expressions will also get you there, but a bit harder to understand off the start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set text;&lt;/P&gt;&lt;P&gt;var2=compress(var1, , 'a');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2015 05:52:15 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-02-13T05:52:15Z</dc:date>
    <item>
      <title>Extract symbol or number from text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167511#M43383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to pick up a symbol or/and number in a paragraph? for example, how to extract "#" or "678" or "#&amp;nbsp; 678" from the following data named as text? The attached dataset can be read into SAS in the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA text;&lt;/P&gt;&lt;P&gt;INFILE "C:\text.txt" &lt;/P&gt;&lt;P&gt;dlm="," lrecl=5000;&lt;/P&gt;&lt;P&gt;informat var1 $256.;&amp;nbsp; &lt;/P&gt;&lt;P&gt;format var1 $256.;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;input var1;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;John&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 05:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167511#M43383</guid>
      <dc:creator>Johnlee</dc:creator>
      <dc:date>2015-02-13T05:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract symbol or number from text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167512#M43384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look into the compress function for starters. Regular expressions will also get you there, but a bit harder to understand off the start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set text;&lt;/P&gt;&lt;P&gt;var2=compress(var1, , 'a');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 05:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167512#M43384</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-13T05:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extract symbol or number from text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167513#M43385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;COMPRESS() is enough powerful for this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set text;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;var2=compress(var1,'#' , 'kd');&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 07:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167513#M43385</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-02-13T07:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract symbol or number from text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167514#M43386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Reeza and Keshan!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 02:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-symbol-or-number-from-text/m-p/167514#M43386</guid>
      <dc:creator>Johnlee</dc:creator>
      <dc:date>2015-02-16T02:32:48Z</dc:date>
    </item>
  </channel>
</rss>

