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!
Sunday, 25 January 2009
Subscribe to:
Post Comments (Atom)
5 comments:
Thanks for sharing.
Regards,
Application for Vehicle
hi, thanks. this help me much...
This is correct
web design mumbai
Great tutorial! It was very helpful!
thank you for sharing this information.
Post a Comment