<?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: How to extract rest of the text after a specific word in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875733#M346022</link>
    <description>Thank you so much.. All these solutions do work</description>
    <pubDate>Mon, 15 May 2023 05:54:50 GMT</pubDate>
    <dc:creator>MrTAL</dc:creator>
    <dc:date>2023-05-15T05:54:50Z</dc:date>
    <item>
      <title>How to extract rest of the text after a specific word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875460#M345902</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, I have a variable called "Customer_Comment&amp;nbsp;" (a string) with free text and I need to extract rest of the comment after specific word.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Word word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word &lt;STRONG&gt;KEYword&amp;nbsp;&lt;/STRONG&gt;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Word&amp;nbsp;word &lt;STRONG&gt;KEYword&amp;nbsp;&lt;/STRONG&gt;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Word word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word &lt;STRONG&gt;KEYword&amp;nbsp;&lt;/STRONG&gt;word word word.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The comments are something like above and what I need is to extract all the text after the key word, if the &lt;STRONG&gt;Keyword&lt;/STRONG&gt; exists&amp;nbsp;in the comment, so the result would be like below..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;word&amp;nbsp;word&amp;nbsp;word&amp;nbsp;word.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;word word word.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried few functions&amp;nbsp;such as SCAN,FIND,SUBSTR but couldn't&amp;nbsp;get it done, so any help is much appreciated!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 13:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875460#M345902</guid>
      <dc:creator>MrTAL</dc:creator>
      <dc:date>2023-05-12T13:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rest of the text after a specific word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875467#M345905</link>
      <description>&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    where=find(customer_comment,'KEYword');
    remaining_text=substr(customer_comment,where+length('KEYword'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 May 2023 13:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875467#M345905</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-12T13:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rest of the text after a specific word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875474#M345909</link>
      <description>Hi, do you have access to Visual Text Analytics? This would be straightforward with LITI syntax in a concept rule. Otherwise you might want to try regular expressions. For example you could use PRXMATCH to match against the pattern then return the remained or the string. &lt;BR /&gt;&lt;BR /&gt;You might try something like this if the data is simple enough:&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;*find pattern location (add 7 to discard keyword);&lt;BR /&gt;position = prxmatch('/KEYword/',text) + 7;&lt;BR /&gt;*substring remainder of text;&lt;BR /&gt;if position gt 7 then out = substr(text,position);&lt;BR /&gt;keep text position out;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 12 May 2023 14:07:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875474#M345909</guid>
      <dc:creator>HarrySnart</dc:creator>
      <dc:date>2023-05-12T14:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rest of the text after a specific word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875475#M345910</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;want=prxchange('s/.*?KEYword(.*)/$1/',-1,have);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as for example in&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA demo;
   LENGTH have want $100;
   have="Word word word word word KEYword word1 word2 word3 word4 word5";
   want=prxchange('s/.*?KEYword(.*)/$1/',-1,have);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 May 2023 14:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875475#M345910</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2023-05-12T14:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rest of the text after a specific word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875731#M346020</link>
      <description>Thank you so much.. it worked..</description>
      <pubDate>Mon, 15 May 2023 05:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875731#M346020</guid>
      <dc:creator>MrTAL</dc:creator>
      <dc:date>2023-05-15T05:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rest of the text after a specific word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875732#M346021</link>
      <description>Thank you so much.. this works tooo</description>
      <pubDate>Mon, 15 May 2023 05:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875732#M346021</guid>
      <dc:creator>MrTAL</dc:creator>
      <dc:date>2023-05-15T05:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rest of the text after a specific word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875733#M346022</link>
      <description>Thank you so much.. All these solutions do work</description>
      <pubDate>Mon, 15 May 2023 05:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875733#M346022</guid>
      <dc:creator>MrTAL</dc:creator>
      <dc:date>2023-05-15T05:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rest of the text after a specific word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875734#M346023</link>
      <description>and.. Unfortunately I don't have access to Visual Text Analytics. I work with SAS EG. However your solution worked.. So all good.</description>
      <pubDate>Mon, 15 May 2023 05:56:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-rest-of-the-text-after-a-specific-word/m-p/875734#M346023</guid>
      <dc:creator>MrTAL</dc:creator>
      <dc:date>2023-05-15T05:56:05Z</dc:date>
    </item>
  </channel>
</rss>

