massive find/replace on MySQL db
| From: | Steve Clay | Date: | Sat, 15 Jun 2002 15:01:19 +0000 |
| Subject: | massive find/replace on MySQL db | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-102339@lists.php.net to get a copy of this message | ||
Hello,
I've inherited a MySQL db (4MB on disk) that's riddled with
inconsistent storage of character entities from being pasted from
Word. At very least I hope to convert all quotes "‘" - "”"
to HTML's """ and "'".
I imagine I'll run a big query, save the id's needing edit in a file
than have a script hit all those, pulling text/varchar fields, using
strtr() to make changes and updating. I suppose I could have the
script just do the 1st 10 in the file, remove those from the file,
then I'd recall the script. I imagine this might take 10/20 minutes.
Am I missing some internal MySQL feature that would do this? Hmm,
what about running strtr() on a mysqldump-ed file? Any advice/links
appreciated. Please CC me.
Thanks a lot!
Steve
--
steve@mrclay.org ** http://mrclay.org