You need to execute an SQL query such that:
Set Name = replace (Name, 'old_string', 'new_string')
where Name RLIKE '^old_string'This only works if the string you are replacing is unique (since there is no way to anchor the replacement).
So, you'd replace something like
Cars
Cars/VW
Cars/BMW
with 'Car' by using
Set Name = replace (Name, 'Cars', 'Car')
where Name RLIKE '^Car'This would _not_ work on a title like:
Cars/Electric Cars
Since that would get replaced with:
Car/Electric Car
I've only replaced sub and sub-sub cagegories, so I was replacing a string like:
Level1/Level2/Level3
With
Level1a/Level2a/Level3a
And the odds of hitting that sort of reproducing pattern were small.
I don't see a regex based replacement within the SQL language, but maybe someone else knows of one.
http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/
Code:
update Category Set Name = replace (Name, 'old_string', 'new_string')
where Name RLIKE '^old_string'
So, you'd replace something like
Cars
Cars/VW
Cars/BMW
with 'Car' by using
Code:
update Category Set Name = replace (Name, 'Cars', 'Car')
where Name RLIKE '^Car'
Cars/Electric Cars
Since that would get replaced with:
Car/Electric Car
I've only replaced sub and sub-sub cagegories, so I was replacing a string like:
Level1/Level2/Level3
With
Level1a/Level2a/Level3a
And the odds of hitting that sort of reproducing pattern were small.
I don't see a regex based replacement within the SQL language, but maybe someone else knows of one.
http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/