Date: Fri, 1 Aug 2003 20:56:12 +0000
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul Dorfman <paul_dorfman@HOTMAIL.COM>
Subject: Re: Compress multiple spaces _outside_ quoted values ?
Content-Type: text/plain; format=flowed
Not too elegant, but you could try
data _null_ ;
retain s " begin 'one quote' no quote ' another quote ' end
do x = index (s, "'") to length (s) ;
if substr (s, x) =: "'" then do ;
p = not p;
if not p then continue ;
if substr (s, x) =: '' then substr (s, x, 1) = 'ff'x ;
s = translate ( compbl (s), '', 'ff'x) ;
put s $100. ;
begin 'one quote' no quote ' another quote ' end string
I bet you have already come up with that much yourself :-).
Paul M. Dorfman
>From: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
>I have a string containing multiple spaces, that typically would be
>compressed out using COMPBL. However, I don't want to remove multiple
>if they are within quotes.
>Any ideas how to achieve this ?
>Richard A. DeVenezia
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.