Jump to content

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


Greywacke

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! :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...