<?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 import text file contains multiple delimiters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549502#M152488</link>
    <description>&lt;P&gt;Translate the tabs to underlines first, and use the underlines as standard delimiter:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile datalines dlm='_' dsd;
input @;
_infile_ = translate(_infile_,'_','09'x);
input city :$20. state : $20. val1 val2;
datalines;
Melbourne_Victoria	240	600	
Sydney_nsw_120_430 
Adelaide_SA_400_500 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first input is just there to fill the buffer (_infile_), and holds the line (@). The second input reads the data.&lt;/P&gt;
&lt;P&gt;proc import is not able to handle such a situation.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2019 06:56:18 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-04-09T06:56:18Z</dc:date>
    <item>
      <title>How to import text file contains multiple delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549499#M152487</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to import text file which contains delimiters such as tab and _ . Underscore is working. But Tab is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile='C:\Users\bijo\Documents\SAS Practice\ImportText2.txt'&lt;BR /&gt;out=p1&lt;BR /&gt;dbms=dlm replace;&lt;BR /&gt;delimiter='_ '09'x ' ;&lt;BR /&gt;Getnames=no;&lt;BR /&gt;proc print;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 06:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549499#M152487</guid>
      <dc:creator>Divya_Joseph</dc:creator>
      <dc:date>2019-04-09T06:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to import text file contains multiple delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549502#M152488</link>
      <description>&lt;P&gt;Translate the tabs to underlines first, and use the underlines as standard delimiter:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile datalines dlm='_' dsd;
input @;
_infile_ = translate(_infile_,'_','09'x);
input city :$20. state : $20. val1 val2;
datalines;
Melbourne_Victoria	240	600	
Sydney_nsw_120_430 
Adelaide_SA_400_500 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first input is just there to fill the buffer (_infile_), and holds the line (@). The second input reads the data.&lt;/P&gt;
&lt;P&gt;proc import is not able to handle such a situation.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 06:56:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549502#M152488</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-09T06:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to import text file contains multiple delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549515#M152493</link>
      <description>&lt;P&gt;Using data step first record is not reading properly......&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 08:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549515#M152493</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2019-04-09T08:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to import text file contains multiple delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549518#M152495</link>
      <description>&lt;P&gt;Use firstobs=2 in the infile statement to skip the header.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, my code (copy/pasted from here directly to the EG Enhanced Editor and submitted):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile datalines dlm='_' dsd;
input @;
_infile_ = translate(_infile_,'_','09'x);
input city :$20. state : $20. val1 val2;
datalines;
Melbourne_Victoria	240	600	
Sydney_nsw_120_430 
Adelaide_SA_400_500 
;
run;

proc print data=test noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;produces this result:&lt;/P&gt;
&lt;PRE&gt;city         state       val1    val2

Melbourne    Victoria     240     600
Sydney       nsw          120     430
Adelaide     SA           400     500
&lt;/PRE&gt;
&lt;P&gt;If you have any trouble, post log ({i} button!) and results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 08:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549518#M152495</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-09T08:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to import text file contains multiple delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549592#M152513</link>
      <description>Thanks for your reply.....&lt;BR /&gt;While iam trying to execute the same code in SAS 9.4 not reading properly</description>
      <pubDate>Tue, 09 Apr 2019 13:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549592#M152513</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2019-04-09T13:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to import text file contains multiple delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549598#M152517</link>
      <description>&lt;P&gt;Find&amp;nbsp; _ 's hex value .and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;delimiter='5F09'x&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 13:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549598#M152517</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-04-09T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to import text file contains multiple delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549912#M152650</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 10:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-text-file-contains-multiple-delimiters/m-p/549912#M152650</guid>
      <dc:creator>Divya_Joseph</dc:creator>
      <dc:date>2019-04-10T10:49:02Z</dc:date>
    </item>
  </channel>
</rss>

