Jump to content

removing \n and \r characters only from a text column in mysql


Greywacke
 Share

Recommended Posts

hi there,what would the sql update query look like to remove new lines and carriage return characters from a text column? i've been searching the web but come up with nothing relative.

Link to comment
Share on other sites

ah was simpler than i thought, updated with the following statements :)

UPDATE 6_serviceleads SET text_LeadAttributes = REPLACE(text_LeadAttributes, "\n", "") WHERE text_LeadAttributes LIKE "%\n%";UPDATE 6_serviceleads SET text_LeadAttributes = REPLACE(text_LeadAttributes, "\r", "") WHERE text_LeadAttributes LIKE "%\r%";

issue resolved! :)

Edited by Pierre 'Greywacke' du Toit
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...