1

I've got users who tried to add a list to a response in an online training course. Here is an example of the issue I'm trying to fix.

I like to eat ramen< br />(\n)fish< br />(\n)frog legs< br />(\n)pizza

The user hit enter after each response to create a list. The newline characters aren't actually visible, but if I just delete the < br /> tag, the user response still shows the line break in Notepad++ and exports from my database improperly.

The course has been fixed so that the HTML tag and newline characters don't come through anymore, but I've got 5250 instances to clean up in a table with a few million rows.

How can I find and delete strings within a string and still keep the response intact? If Notepad++ could handle this large of a file, I'd just pull the data out and replace all instances of < br/>(\n) with a "-" or " " and then load it all back in. How can I do that using MariaDB?

(I know the < br/> tag shouldn't have a leading space, but I put the space in to keep make it visible in my question)

Supakeepa
  • 11
  • 2
  • possible duplicate of [How to remove new line characters from data rows in mysql?](http://stackoverflow.com/questions/1504962/how-to-remove-new-line-characters-from-data-rows-in-mysql) – horsefeathers Mar 28 '15 at 00:48
  • Sorry. My question was not specific enough. I've got users who tried to add a list to a response in a training course. Here is an example of what I have: I like to eat ramen
    (\n)fish
    (\n)frog legs
    (\n)pizza The user hit enter after each response to create a list. The newline characters aren't actually visible, but if I just delete the
    tag, the user response still shows the line break in Notepad++ and exports from my database improperly.
    – Supakeepa Mar 30 '15 at 15:59
  • The course has been fixed so that the HTML tag and newline characters don't come through anymore, but I've got 5250 instances to clean up in a table with 1 million plus rows. From what I recall, the TRIM function will remove all white space at the ends of a string. I need a way to clean out the html tag and newline characters from within a string. – Supakeepa Mar 30 '15 at 16:01

0 Answers0