<?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: Need help with delimiter for text file in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546743#M8262</link>
    <description>&lt;P&gt;or just&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data read_text;
infile datalines  dlm='"|"';
input NAME $ HEIGHT $  TITLE : $10.;
cards;
TEVIN "|" 6'4 "|" FORWARD
TEVIN "|" 6'4 "|" FORWARD
TEVIN "|" 6'4 "|" FORWARD
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Mar 2019 22:10:38 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-03-27T22:10:38Z</dc:date>
    <item>
      <title>Need help with delimiter for text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546734#M8260</link>
      <description>&lt;P&gt;Hi wonderful SAS community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a data step view for a large text file. The text file has the following delimiter&amp;nbsp; &amp;nbsp; "|"&amp;nbsp; &amp;nbsp;(i.e. a pipe surrounded by double quotes). Sample data is below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NAME "|" HEIGHT "|" TITLE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TEVIN&amp;nbsp;"|" 6'4&amp;nbsp;"|" FORWARD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When writing the infile statement, what should I put for the delimiter (DLM=) I've tried DLM='"|"" with no DSD and am getting funny results.&lt;/P&gt;&lt;P&gt;Any help you can provide would be much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 21:59:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546734#M8260</guid>
      <dc:creator>procsql</dc:creator>
      <dc:date>2019-03-27T21:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with delimiter for text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546737#M8261</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/261356"&gt;@procsql&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data read_text;
if _n_=1 then k='"|"' ;
infile datalines  dlm=k;
input NAME $ HEIGHT $  TITLE : $10.;
cards;
TEVIN "|" 6'4 "|" FORWARD
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Mar 2019 22:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546737#M8261</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-27T22:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with delimiter for text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546743#M8262</link>
      <description>&lt;P&gt;or just&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data read_text;
infile datalines  dlm='"|"';
input NAME $ HEIGHT $  TITLE : $10.;
cards;
TEVIN "|" 6'4 "|" FORWARD
TEVIN "|" 6'4 "|" FORWARD
TEVIN "|" 6'4 "|" FORWARD
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Mar 2019 22:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546743#M8262</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-27T22:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with delimiter for text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546755#M8264</link>
      <description>&lt;P&gt;It would be safer to switch to dlmstr= instead of dlm=.&amp;nbsp; Not knowing what might appear in your data, dlm= might have a flaw.&amp;nbsp; It would treat any pipe as a delimiter, whether or not it is surrounded by quotes.&amp;nbsp; So ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;infile source dsd dlmstr='"|"';&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 22:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546755#M8264</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-27T22:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with delimiter for text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546765#M8268</link>
      <description>&lt;P&gt;Did you check if it is possible to have them create a more reasonable file?&amp;nbsp; It really looks like perhaps they did quite get the concept of a delimited file.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 01:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546765#M8268</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-28T01:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with delimiter for text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546955#M8305</link>
      <description>&lt;P&gt;If the data is not terribly sensitive then use a text editor to copy 10 or 15 lines or so and paste into a code box (&lt;STRONG&gt;important&lt;/STRONG&gt;) opened using the forum's {I} icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If some of the data is sensitive then replace it with values like "XXXXXXX" and "YYYYYYY" for character values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did this project come with anything that described the data? Such as which fields should be numeric and character and what format/ length of values are supposed to be in the file? That is the first place to start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way your example dlm has unbalanced quotes:&lt;/P&gt;
&lt;PRE&gt;DLM ='"|"" &lt;/PRE&gt;
&lt;P&gt;You would want to use&lt;/P&gt;
&lt;PRE&gt;DLMSTR = '"|"'&lt;/PRE&gt;
&lt;P&gt;to use the whole value as a single delimiter.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 22:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/546955#M8305</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-29T22:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with delimiter for text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/547060#M8327</link>
      <description>&lt;P&gt;Thank you (and everyone else) who contributed to answering this question. You all are amazing!&lt;/P&gt;&lt;P&gt;I made one slight modification. Just used dlmstr='"|"' and removed the dsd part.&amp;nbsp; It worked perfectly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 23:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-delimiter-for-text-file/m-p/547060#M8327</guid>
      <dc:creator>procsql</dc:creator>
      <dc:date>2019-03-28T23:44:54Z</dc:date>
    </item>
  </channel>
</rss>

