<?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: Help in Reading the Text file and output only the email in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294515#M60059</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11613"&gt;@pp2014&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yes, the &amp;nbsp;structure is exactly same all the time&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We can only respond to what you say....&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2016 19:50:02 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-08-26T19:50:02Z</dc:date>
    <item>
      <title>Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294387#M60039</link>
      <description>&lt;P&gt;I have following data in Text file separated by ; &amp;nbsp;delimiter. &amp;nbsp;I want only the email addresses separated by ; delimiter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doe, John &amp;lt;john.doe@abc.com&amp;gt;;Smith, Jeff &amp;lt;jeff.smith@abc.com&amp;gt;; lever, dave &amp;lt;dave.lever@abc.com&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output should be:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;john.doe@abc.com;jeff.smith@abc.com;dave.lever@abc.com&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any help in this will be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 13:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294387#M60039</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2016-08-26T13:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294389#M60040</link>
      <description>&lt;P&gt;Look at scan function with &amp;lt;&amp;gt; as delimiters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your data structure exactly this all the time?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 13:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294389#M60040</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-26T13:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294390#M60041</link>
      <description>&lt;P&gt;Look at scan function with &amp;lt;&amp;gt; as delimiters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your data structure exactly this all the time?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 13:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294390#M60041</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-26T13:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294391#M60042</link>
      <description>&lt;P&gt;Yes, the &amp;nbsp;structure is exactly same all the time&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294391#M60042</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2016-08-26T14:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294394#M60043</link>
      <description>&lt;P&gt;Are already reading in the file with three separate fields or as one long text field. Where in the process of reading the file are you, what does your code look like so far?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294394#M60043</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-26T14:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294395#M60044</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like the following should get you started.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want;&lt;/P&gt;
&lt;P&gt;informat name1-name3 $30. Email1-email3 $50.;&lt;/P&gt;
&lt;P&gt;imfile filepath dlm=';&amp;lt;&amp;gt;' DSD Truncover ;&lt;/P&gt;
&lt;P&gt;input name1 $ email1$ name2$ email2 $ ...;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294395#M60044</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-26T14:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294397#M60045</link>
      <description>&lt;P&gt;It can be considered 3 separate fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final output should have only email addresses separated by ; delimiter&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294397#M60045</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2016-08-26T14:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294399#M60046</link>
      <description>&lt;P&gt;You'll need to read them separately. You can concatenate them back together with a CATX function and drop fields you don't need.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294399#M60046</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-26T14:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294403#M60047</link>
      <description>&lt;P&gt;Thanks Reeza for all the help...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294403#M60047</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2016-08-26T14:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294487#M60054</link>
      <description>&lt;P&gt;I am trying to read the email_list file and output only email addresses separated by semi-column. &amp;nbsp;But my code goes into a loop.&lt;/P&gt;
&lt;P&gt;Can anybody help me in this??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;email_file.txt has following records:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doe, John &amp;lt;john.doe@abc.com&amp;gt;;Smith, Jeff &amp;lt;jeff.smith@abc.com&amp;gt;; lever, dave &amp;lt;dave.lever@abc.com&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my code:&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt; length text $32767;&lt;BR /&gt; &lt;BR /&gt; infile 'c\email_file.txt' lrecl=32767 dsd dlm='09'x truncover;&lt;BR /&gt; &lt;BR /&gt; input text $;&lt;BR /&gt; &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data t1;&lt;BR /&gt; set test;&lt;BR /&gt;length tx3 $500;&lt;BR /&gt;tx3="";&lt;BR /&gt;tx1=text;&lt;BR /&gt;do until (length(cats(tx1))=0);&lt;BR /&gt;space_position = INDEX(tx1, '&amp;lt;');&lt;BR /&gt;slash_position = INDEX(tx1, '&amp;gt;');&lt;BR /&gt;space_to_slash = slash_position - space_position;&lt;BR /&gt; tx2 = substr(tx1, space_position+1, space_to_slash-1);&lt;BR /&gt; tx3=cats(tx3,tx2,";");&lt;BR /&gt; tx4=substr(tx1,find(tx1,";")+1);&lt;BR /&gt; tx1=tx4;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 17:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294487#M60054</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2016-08-26T17:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294513#M60057</link>
      <description>&lt;P&gt;Why didn't you use the SCAN function as suggested?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If your data is as indicated, only 3 emails per line you don't need all of that. Assuming that the text string is being read in correctly - which you should test first - this works for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
&lt;SPAN&gt;data test;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;length text $32767;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;infile 'c\email_file.txt' lrecl=32767 dsd dlm='09'x truncover;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;input text $;&lt;/SPAN&gt;
email1 = scan(text, 2, "&amp;lt;&amp;gt;;");
email2 = scan(text, 4, "&amp;lt;&amp;gt;;"); 
email3 = scan(text, 6, "&amp;lt;&amp;gt;;");
want = catx(";", of email1-email3);&lt;BR /&gt;keep want;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Aug 2016 19:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294513#M60057</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-26T19:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294514#M60058</link>
      <description>&lt;P&gt;I have almost 170 email addresses.. &amp;nbsp;Anyway I was able to fix my code. &amp;nbsp; Thanks Reeza for help...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 19:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294514#M60058</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2016-08-26T19:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Reading the Text file and output only the email</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294515#M60059</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11613"&gt;@pp2014&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yes, the &amp;nbsp;structure is exactly same all the time&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We can only respond to what you say....&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 19:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-in-Reading-the-Text-file-and-output-only-the-email/m-p/294515#M60059</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-26T19:50:02Z</dc:date>
    </item>
  </channel>
</rss>

