[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 45 strings in 45 mysql databases



On 19-12-2014 21:56, Frans van Berckel wrote:
Mijn doel is ongeveer 45 urls per site in 45 websites aan te passen.


BEGIN
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME,
‘www.domain1.com’, ‘www.other1.com’);
.
.
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME,
‘www.domain2.com’, ‘www.other2.com’);
.
.
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME,
‘www.domain3.com’, ‘www.other3.com’);
END //



Waarom niet met sed ?

echo www.domain2.com | sed 's/www.domain\(.*\).com/www.other\1.com/'


Reply to: