I've recently had line breaks added to some data i've imported. Here's how you remove line breaks at the beginning and end of a field in mysql;
update temp_table set fieldname=trim(both char(13) from fieldname)
The above is only if you are in windows. I believe you can also use the folowing for linux;
update temp_table set fieldname=trim(both '\n' from fieldname)
You should also be able to use reaplce usinng the char method, e.g.
update temp_table set fieldname=replace(fieldname, char(13), '-')
I've not tested it though - I hope this helps!
Showing posts with label Mysql Remove Replace Line Breaks Trim. Show all posts
Showing posts with label Mysql Remove Replace Line Breaks Trim. Show all posts
Sunday, 25 January 2009
Subscribe to:
Posts (Atom)