<?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 How to handle line breaks in csv files in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-handle-line-breaks-in-csv-files/m-p/29244#M6846</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like your CSV contains EXCEL hard returns '0A'x, produced by &amp;lt;CNRL&amp;gt;ENTER in EXCEL.&amp;nbsp; You should be able to fix this with the FILENAME statement option TERMSTR.&amp;nbsp; Put your filepath where I have the string 0a.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; FT44F001 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'0a.csv'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;termstr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=CRLF;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;import&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;datafile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=FT44F001 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=csv replace &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;dbms&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=csv;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jul 2011 12:02:03 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-07-12T12:02:03Z</dc:date>
    <item>
      <title>How to handle line breaks in csv files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-handle-line-breaks-in-csv-files/m-p/29243#M6845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I have a csv file with a line break in one of the columns enclosed by ". Am havign trouble importing them to SAS using proc import.Can anyone please help me on this..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is an example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;test.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name&amp;nbsp; address&lt;/P&gt;&lt;P&gt;abc,"aaa,&lt;/P&gt;&lt;P&gt;China"&lt;/P&gt;&lt;P&gt;def,"ccc,USA"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you observe first row has a new line character in address column and proc import treats it differently..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am using the below code for import..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc import datafile = "C:\test.csv" out = test dbms = csv replace;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 09:42:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-handle-line-breaks-in-csv-files/m-p/29243#M6845</guid>
      <dc:creator>kishore415</dc:creator>
      <dc:date>2011-07-12T09:42:40Z</dc:date>
    </item>
    <item>
      <title>How to handle line breaks in csv files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-handle-line-breaks-in-csv-files/m-p/29244#M6846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like your CSV contains EXCEL hard returns '0A'x, produced by &amp;lt;CNRL&amp;gt;ENTER in EXCEL.&amp;nbsp; You should be able to fix this with the FILENAME statement option TERMSTR.&amp;nbsp; Put your filepath where I have the string 0a.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; FT44F001 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'0a.csv'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;termstr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=CRLF;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;import&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;datafile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=FT44F001 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=csv replace &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;dbms&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=csv;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 12:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-handle-line-breaks-in-csv-files/m-p/29244#M6846</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-07-12T12:02:03Z</dc:date>
    </item>
  </channel>
</rss>

