I don't have any suggestions for a script, but I've wrestled with this issue
before in other places. It is very difficult to regularize the format of a
full name:

Johnson, Jr. - Fred
Applewhite-Smith, Pamela
Quimby III, Roger Alan

etc. I suppose it all depends upon how bad the existing data is, and how
picky you are about the results.

You can probably do what you want with a combination of REGEXP, IF,
SUBSTRING, and CONCAT; but it would take more time than I have to work it
out.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341


> -----Original Message-----
> From: Mark [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 25, 2006 1:18 PM
> To: mysql@lists.mysql.com
> Subject: Remove unwanted characters from a name field
>
> I have a field called name which stores a person's first, middle and
> last name.
>
> Previously, these names (17800 of them) were entered in the
> database by
> different people so there was no consistency in the format
> used. There
> are now names entered such as:
>
> Smith, John S.
> Doe - Jane W.
> Doe John
>
>
> What I would like to do is to have a script that can update
> the database
> and make all names appear with a comma separating the last and first
> name as shown in the first example: Smith, John S.
>
> The rest of the name format does not matter.
>
> Is this possible and if so, can someone be kind enough to
> help with such
> a script and or point me in the right direction.
>
> Thanks
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to