View Single Post

   
  #4 (permalink)  
Old 02-28-2008, 06:05 AM
Stephen Cook
 
Posts: n/a
Default Re: Using replace with New Lines

I always go with REPLACE(REPLACE(STRING, '\n', ''), '\r', ''), since
depending on where your data came from there may be one or the other, or
both. Although if there is a shorthand/more efficient way I'd love to
hear it.


Lucas.CTR.Heuman@faa.gov wrote:
> Ok.. I found the problem.. I needed to add a \r.. but now that opens up
> the question can I have a Multi replace search in replace?
>
>
> Example can I do something like this in MySQL
>
> REPLACE (STRING,'\r' or '\n',' ')
>
>
> REPLACE(DESCRIPTION,'\r\n',' ')
>
> Wishing you the best you know you deserve,
>
> ______________________
>
>
>
>
>
> Hello Group,
>
> Looking to use this REPLACE to strip multi line data out of my return
> data.
>
> I am having problems getting the \n to work correctly, any ideas?
>
> REPLACE(DESCRIPTION,\n,' ')
>
>
> SELECT
> rpad(CASE WHEN DESCRIPTION IS NULL THEN '' ELSE
> REPLACE(DESCRIPTION,'\n',' ') END,80,' ') as var
> FROM hardware;
>
>
>
> Wishing you the best you know you deserve,
>
> ______________________
> Lucas Heuman
> CM Web Developer
> SRA International, Inc.
> FAA, WJHTC/Bldg 300, 2nd Fl., H33
> Atlantic City Int'l Airport, NJ 08405
> Phone 609.485.5401
>

Reply With Quote