Page 1 of 1

mysql find and replace

Posted: Tue Sep 18, 2007 2:46 am
by aussie_clint
I wanted to convert a excel file to csv so i can import it to mysql but it has comers in it (,) so i replaced them with # and now im trying to run this query in mysql query browser to change them back to a coma

Code: Select all

update `newprice list` set `newprice list`.Description = 
replace([field_name],'[#]','[,]');
Can anyone tell me where im going wrong?

Thanks
Clint

Posted: Tue Sep 18, 2007 5:14 am
by mezise
Hi Clint,

I think the problem lies in square brackets used in search and replace strings. Following query should work.

Code: Select all

update `newprice list` set `newprice list`.Description =
replace(`newprice list`.Description,'#',',');
Michal