Remove carriage return and linefeed characters within quoted strings


/ Published in: SAS
Save to your folder(s)

If a flat file contains embedded carriage return (CR) and linefeed characters (LF) inside double quotes, SAS will interpret them as end of line markers. This may cause your file to be read incorrectly.
This example replaces CR/LF characters within double quotes with other printable characters. CR/LF characters outside of double quotes are untouched.

In this sample, the external file is updated in place. You cannot separate the input and output because the code uses shared buffers.

You should make a copy of your file before running this sample on it.

URL: http://support.sas.com/kb/26/065.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.