LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 2 Jun 2005 17:49:05 -0700
Reply-To:   cassell.david@EPAMAIL.EPA.GOV
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "David L. Cassell" <cassell.david@EPAMAIL.EPA.GOV>
Subject:   Re: Eliminate embeded carriage return in CSV file under version 8
In-Reply-To:   <35f85b7d050602124128138d0c@mail.gmail.com>
Content-type:   text/plain; charset=US-ASCII

Adam <worldtraveller999@GMAIL.COM> wrote: > I have a name and address file in which the address field contains > embeded carriage returns using the infile statement results in a > dataset with multiple data records > > addr > addr > addr > > I want to replace the carriage return with a space to generate one > address field per name can anyone suggest a solution.

The following rambling assumes that you're working on a Win32 box. If not, then you need to correct me.

Are these 'carriage returns' or 'hard returns'? I mean, when you look at the file in a hex editor, are these a single character, or the two-character hard return '0D0A'x that MS-DOS uses to end lines of text files? If they are only the '0D'x or '0A'x character, then it will be a lot easier to yank them out programatically. If they're the standard two-character hard return, then you'll have to come up with a system by which a computer can tell when you're at the end of a line and when you're in the middle of an address. That depends on the structure of your data, which I can't quite make out from way over here. :-)

Can you write back to SAS-L (not to me personally) and give us some guidance? Please tell us: what OS you're using; what software created the file and why it can't be fixed before coming to you; how your data look; what the hex codes for your breaks are; and how you can tell when the newline is supposed to be there.

Awaiting your reply, David -- David Cassell, CSC Cassell.David@epa.gov Senior computing specialist mathematical statistician


Back to: Top of message | Previous page | Main SAS-L page