0

I have a MySQL database that contains a couple of MEMO field types that have text that contains html break tags (<br />)

I want to globally remove these tags and insert a new line in the memo field at this point (I believe this is the ascii 10 character)

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
lifeson
  • 171
  • 2
  • 12
  • So what's stopping you? – stark Sep 01 '14 at 11:43
  • @stark I don't know how to? – lifeson Sep 01 '14 at 12:01
  • possible duplicate of [Update a column value, replacing part of a string](http://stackoverflow.com/questions/10177208/update-a-column-value-replacing-part-of-a-string) – Cas Wolters Sep 01 '14 at 14:37
  • @CasWolters it is not a duplicate as that is asking how to replace one part of a string with another string, I want to replace part of a string with a non visible control character – lifeson Sep 01 '14 at 14:54

1 Answers1

0

Use the replace statement:

UPDATE table SET field = REPLACE(field, '<br/>', '\r\n');

The string representation of a new line/linefeed is \n and \r. You can use one or both according to your needs.

Cas Wolters
  • 371
  • 3
  • 11