<?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: Carriage Returns - Need to be removed in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83092#M256787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a bunch Tom. This problem has haunted me for the last year. I have tested the code on several production files and it does appears to working exactly the way I need it too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for showing me that trick as well, I really like the simplicity in the Do Until loop testing for the double quotes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Feb 2013 17:25:29 GMT</pubDate>
    <dc:creator>Anotherdream</dc:creator>
    <dc:date>2013-02-05T17:25:29Z</dc:date>
    <item>
      <title>Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83079#M256774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone. I have come across numerous csv files that have carraige returns, and line feeds, and the combination of Carraige Returns+Line Feeds&amp;nbsp; within large sections of comment data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know a process that can be used to properly read in these files that does not use the popular infile "sharebuffers" trick? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am operating in a windows environment. My current process is to open the file within excel, add a column of smiley faces to the end of the csv file, and then open cygwin to strip out all CR , LF, or CR+LF and then replace the smiley faces with CR+LF. This process works fine, however I'd like to remove excel and Cygwin completely from the equation for obvious reasons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thanks!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 00:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83079#M256774</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-01-23T00:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83080#M256775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If anyone can help with this problem it would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The smiley face method is now causing issues because users are adding free string text to the end of their excel files, however the business would like these files to be identified so they can go in and concatenate the string variables into the final column (like they're supposed to be).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However since the files have carriage return and line feeds in them, I cannot read them using any standard fashion. This combination of problems has basically rendered the business request impossible, unless I can get some assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you kindly!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 23:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83080#M256775</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-02-04T23:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83081#M256776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One question is how messy are the files.&amp;nbsp; If the problem is just that the text in some cells contain CR or LF (but not any CR+LF combinations) then you should be able to read the file properly with SAS by using the TERMSTR=CRLF option on the INFILE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next level is if the file does contain CR+LF embedded in the middle of a cell, but those cells are properly quoted then you might be able to fix it by pre-processing the files with SAS.&amp;nbsp; See this thread.&amp;nbsp; &lt;A __default_attr="39913" __jive_macro_name="thread" class="jive_macro jive_macro_thread" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 00:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83081#M256776</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-05T00:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83082#M256777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tom. Sadly I cannot use the TERMSTR option (this is what I did when I was taught SAS recently), and I also cannot use an infile - file option, as the software my company has does not have either of these options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is basically is this possible without the use of the TERMSTR option?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 03:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83082#M256777</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-02-05T03:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83083#M256778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read the answer to the thread I linked. It should work for any CSV file that Excel would write (or be able to read).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 04:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83083#M256778</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-05T04:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83084#M256779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya Tom. I did read your thread and I tried the code and it did not work sadly. I am not using base SAS, but a SAS emulator, and sadly this emulator does not have the TERMSTR option or the ability to read in a csv file and then output to it using the infile , file option (Which it looks like your code did). to make sure we're on the same page, when you say the code that should work, you're refering to the one that was selected as "best answer" correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 04:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83084#M256779</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-02-05T04:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83085#M256780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;You do not need TERMSTR, or use shared buffers to modify the original file.&amp;nbsp; Just read from the original file and create a new file that has the extra line breaks removed.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;filename old 'original.csv';&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;filename new 'fixed.csv';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;data _null_ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp; if eof then put 'NOTE: Records read=' newn 'Records with missing quotes=' missq ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp; infile old &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;lrecl=10000 &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;end=eof &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp; file new lrecl=10000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp; nq=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp; do until (mod(nq,2)=0 or eof );&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newn+1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nq = nq + countc(_infile_,'"');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put _infile_ @;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if mod(nq,2) then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; missq+1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '|' @;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp; put;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 04:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83085#M256780</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-05T04:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83086#M256781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again Tom. Okay so that's good news, however this code looks like it only removes line feeds. I actually need a code that will remove line feeds AND carriage returns (plus the combination). It appears people are inputting ALT-ENTER into their excel files, which the csv will read as (I believe) CR+LF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually below is the copy of the Word Document version of the csv I need fixed. Basically Var2 in row 1 (key variable 1) are the words hey How, however there is an Alt Enter between them. I need sas to put those onto one line (or ast least one variable) but still created a second row after var3. So my final output should look like the dataset below it.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&amp;nbsp; ORIGINAL&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;key,var1,var2,var3&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1,a,"hey&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;how",a&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2,a,a,a&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3,a,a,a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEED&lt;/P&gt;&lt;P&gt;key,var1,var2,var3&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1,a,"hey how",a&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2,a,a,a&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3,a,a,a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry if my explanation is or was not correct. I am by no means a SAS expert and this was the first computer language I taught myself about a year ago, so still have a lot left to learn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need any more information from me! Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 04:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83086#M256781</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-02-05T04:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83087#M256782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should work fine. You might end up with CR ('0D'X) appearing as part of the text (rather than as line breaks) as SAS reads the original file. You could convert them to spaces by adding this line right after the INPUT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_INFILE_ = TRANSLATE(_INFILE_,' ' ,'0D'x);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 05:29:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83087#M256782</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-05T05:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83088#M256783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hurray! Thank you for that extremely detailed answer. I do have one last question to mark this a complete solution. If someone actually entered a CRLF combination into a quoted box would I be able to add the following line right after the new _infile_ statement to "fix" this occurance?&amp;nbsp; Users are sometimes copying complete values from PDF documents which span multiple lines, so that distinct combination is making the boxes with smiley faces appear within Excel. (I believe the boxes with smiley faces are CRLF, but please correct me if I am incorrect).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_INFILE_ = TRANSLATE(_INFILE_,' ' ,'0DA'x);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much Tom!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 16:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83088#M256783</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-02-05T16:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83089#M256784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically yes.&amp;nbsp; You need to include both HEX digits for each character specifying the literal.&amp;nbsp; '0D0A'x&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The TRANSLATE function is a little confusing.&amp;nbsp; It translates character by character. Plus the order of the arguments is backwards as the replacement characters are listed first.&amp;nbsp; So TRANSLATE(X,'&amp;nbsp; ','0D0A'x) will convert all CR to spaces and all LF to spaces.&amp;nbsp; Whether they are adjacent in the source string or not.&amp;nbsp; In general if you just want to convert the garbage into something useful that should be good enough.&amp;nbsp; If however you want to preserve the concept of having a line break embedded into the string they you might want to convert them to something other than a space. If you want to specifically convert CR+LF and not just convert all CR and all LF then you would want to use TRANWRD function instead.&amp;nbsp; But if you are reading the data from text file then I do not believe you will ever get the CR+LF into your character variables.&amp;nbsp;&amp;nbsp; If you use PROC IMPORT directly from the Excel file then you might be able to have CR+LF appear in the character strings in SAS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 16:28:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83089#M256784</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-05T16:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83090#M256785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general I do not want to preserve the idea of a line break within my comments. I want them to just be replaced with a space... So to confirm, if this is the case I can just put the _infile_=TRANSLATE(_infile,' ','0D0A'x);.&amp;nbsp; after the input statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would i be able to remove the other portion of the code than, the portion after the put _infile_ @; statement (or would leaving it cause any distinct problems)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again, I am marking your answer as correct!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 16:33:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83090#M256785</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-02-05T16:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83091#M256786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need the rest of the code. That is the part that is gluing together the lines that SAS's normal INFILE processing is treating as separate lines.&lt;/P&gt;&lt;P&gt;The basic idea of the program is that when the currently constructed line has unbalanced quotes then it is an indication that the line has been split.&amp;nbsp; So by outputting the line to the new file with a trailing @ the line break is removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason that you will also need to include the TRANSLATE function call is that when SAS sees just a CR by itself it will not treat that as a new line.&amp;nbsp; So the trailing @ trick will not effect those embedded CR characters.&amp;nbsp; Then when you try to print the value of those variables in your final dataset they will cause strange results.&amp;nbsp; From my experiments when reading files SAS will always treat the LF as marking a new line.&amp;nbsp; On Windows it will also remove any CR that appear right before the LF (that is the normal end of line on Windows).&amp;nbsp; On Unix the CR before the LF will stay in the data, appearing as the last character on the line.&amp;nbsp; Any CR by itself will also stay in the data rather than being treated as a line break.&amp;nbsp; So by converting the CR to spaces before writing them out the new file they will be gone.&amp;nbsp; In my experience the LF will not appear in the _INFILE_ automatic variable, but there is no harm is trying to convert them to spaces in case I am wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 16:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83091#M256786</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-05T16:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83092#M256787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a bunch Tom. This problem has haunted me for the last year. I have tested the code on several production files and it does appears to working exactly the way I need it too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for showing me that trick as well, I really like the simplicity in the Do Until loop testing for the double quotes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 17:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83092#M256787</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-02-05T17:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83093#M256788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom, I ran this code and on 90% of the files I have run into it works, however on a few files the process only seems to remove carriage returns and line feeds for the first X rows (say 1000) and then after that the process simply stops removing all values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an inherent limitation to what type of files this process will work on?&amp;nbsp; The rows in which the data stops are only 10,000 characters of values, so I do not believe it is bumping up against the lrecl limit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 17:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/83093#M256788</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-02-12T17:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/368371#M256789</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to use your code to get rid of linefeed characters. &amp;nbsp;Somehow it is not working for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have Pipe delimited csv file and it has linefeed characters. &amp;nbsp; &amp;nbsp;I would appreciate if you can help me how to read pipe delimited file with Linefeed characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 15:52:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/368371#M256789</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2017-06-19T15:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/368376#M256790</link>
      <description>&lt;P&gt;This method would work only if the embedded linefeeds are enclosed in quotes. Also if your delimiter is | then you would want it to put and extra '|' to replace the embedded linefeed. You could have it put a space or just nothing to remove the linefeed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you data has extra linefeed, but they are not quoted then a method that counts the number of | would be better. &amp;nbsp;But for that you would need to know the number of | that you expect in each line.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 16:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/368376#M256790</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-19T16:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/368381#M256791</link>
      <description>&lt;P&gt;That code was written using LRECL=10000. If your actually file has lines as long as 10,000 characters then it will probably truncate the data. &amp;nbsp;If you have lines longer than 32K then you will need to use a method that reads the file byte by byte instead.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 16:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/368381#M256791</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-19T16:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Carriage Returns - Need to be removed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/368394#M256792</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the following headers :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Survey Name|Contact Name|Follow-up History|Last Follow-up Date|Last Follow-Up Comment&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Altogether 4 pipes in between.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How to read the file with pipe delimited having carriage control..&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:11:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Carriage-Returns-Need-to-be-removed/m-p/368394#M256792</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2017-06-19T17:11:37Z</dc:date>
    </item>
  </channel>
</rss>

