<?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 read a comma delimited file with human error &amp;quot;enter&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321357#M70940</link>
    <description>&lt;P&gt;If this is a once-off excercise and you don't have to many data then I would either send the data back to the sender and ask to fix it or then just read in the data into a single string, count the double quotes and then go into the lines with odd counts and fix it manually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF the manual enters are not end of line delimiters - eg. under Windows end of line would be CRLF but a "manual" enter could just be an LF - then the issue wouldn't be that big and SAS would still treat the record as being on a single line. You would then just have to remove the LF programmatically.&lt;/P&gt;
&lt;P&gt;I normally use Notepad ++ to determine how things really look like. Just open the text file and under View/Show Symbol select "show all characters".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally: Post an attachment with your data and also tell us under which OS you're running SAS.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Dec 2016 22:50:07 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2016-12-27T22:50:07Z</dc:date>
    <item>
      <title>how to read a comma delimited file with human error "enter"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321352#M70936</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I typically don't deal with "unstructured" text and I know there is a solution to this,&amp;nbsp;I'd appreciate for any guidance and help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a comma delimited file read as such, string variable will be between two quotes, and numeric will not have quotes.&lt;/P&gt;&lt;P&gt;The first line is the variable name, y1, y2, y3, where y1 and y2 are strings and y3 is numeric.&amp;nbsp;&lt;/P&gt;&lt;P&gt;as you can notice the second row, there is a human error of "enter" to a new line&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;v1: (with human "enter")&lt;/P&gt;&lt;P&gt;"y1","y2","y3"&lt;BR /&gt;"ASLG","SDF",5&lt;BR /&gt;"asldhl", "ser,g&lt;BR /&gt;sdfj",3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;v2: (this is how it's supposed to be)&lt;/P&gt;&lt;P&gt;"y1","y2","y3"&lt;BR /&gt;"ASLG","SDF",5&lt;BR /&gt;"asldhl", "ser,gsdfj",3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;v3:(output desired)&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;y1&lt;/TD&gt;&lt;TD&gt;y2&lt;/TD&gt;&lt;TD&gt;y3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ASLG&lt;/TD&gt;&lt;TD&gt;SDF&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;asldhl&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;ser,gsdfj&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would someone please help me, is there anyway I can read the data from v1 to v3?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joanne&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 22:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321352#M70936</guid>
      <dc:creator>tsai1108_gmail_com</dc:creator>
      <dc:date>2016-12-27T22:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to read a comma delimited file with human error "enter"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321357#M70940</link>
      <description>&lt;P&gt;If this is a once-off excercise and you don't have to many data then I would either send the data back to the sender and ask to fix it or then just read in the data into a single string, count the double quotes and then go into the lines with odd counts and fix it manually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF the manual enters are not end of line delimiters - eg. under Windows end of line would be CRLF but a "manual" enter could just be an LF - then the issue wouldn't be that big and SAS would still treat the record as being on a single line. You would then just have to remove the LF programmatically.&lt;/P&gt;
&lt;P&gt;I normally use Notepad ++ to determine how things really look like. Just open the text file and under View/Show Symbol select "show all characters".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally: Post an attachment with your data and also tell us under which OS you're running SAS.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 22:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321357#M70940</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-27T22:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to read a comma delimited file with human error "enter"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321359#M70941</link>
      <description>&lt;P&gt;What happens when you import now?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post your code please, if using a data step make sure to specify the DSD option&lt;/P&gt;
&lt;P&gt;I would consider a FIND-REPLACE ALL in a text editor such as Notepad++&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 23:10:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321359#M70941</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-27T23:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to read a comma delimited file with human error "enter"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321360#M70942</link>
      <description>&lt;P&gt;You could do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile datalines firstobs=2 truncover;
length y1 $12 y2 $12 y3 8 q $200;
do until (mod(countc(q,'"'),2)=0);
    input line $200.;
    q = cats(q, line);
    end;
y1 = scan(q,1,",","qr");
y2 = scan(q,2,",","qr");
y3 = input(scan(q,3,",","qr"), ?? best.);
drop line q;
datalines;
"y1","y2","y3"
"ASLG","SDF",5
"asldhl", "ser,g
sdfj",3
;

proc print data=test; run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Dec 2016 23:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321360#M70942</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-12-27T23:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to read a comma delimited file with human error "enter"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321402#M70961</link>
      <description>&lt;PRE&gt;


data want;
infile 'c:\temp\test.txt' recfm=n dsd dlm='0A2C'x;
input (y1 y2 y3) (:$20.) @@;
run;

&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Dec 2016 10:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-a-comma-delimited-file-with-human-error-quot-enter/m-p/321402#M70961</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-12-28T10:05:05Z</dc:date>
    </item>
  </channel>
</rss>

