Continuing on my Off-Topic rant: I hate VBA.
On the other hand, I've managed to get a
reasonably complex parser written in it.
Taking a name - Osfameron.Adon@mycompany.com -
it will split it into First, Mid, and Last names.
Trivial? But our email address books have
oddities like Dutch names having the prefix
added to the first name - Wijnand-van-der.Valk@mycompany.com... And of course these
prefixes should be part of the Middle name
(to make alphabetising surnames less 'V' heavy...)
whereas French prefixes shouldn't ("Le Brun")
With the various rules that we need to follow for this, it's a tricky but fundamentally doable task for Perl and Regular Expressions, but a horrible tarpit for VBA.
On topic?: Perl helped me write this application:
use strict;(I don't think that
Option Explicitis the same)
On Error Goto
Re:Prefix parsing
osfameron on 2002-05-30T13:18:30
Yes, I thought of that only an hour ago... I guess I need a flag for "Dutch style" or "French style" parsing of 'de' prefixes, phew!French/Dutch Prefix parsing
osfameron on 2002-05-30T15:12:44
Hmmm, in our email address-list most of the names are set up so thate.g. there are 2 differences:French: Charles.De-Gaulle
Dutch: Wijnand-de.WitteI've made use of the 1st fact to make all "De" part of the last name. However I can't use the 2nd fact without a rewrite because of the (rather crufty) procedure I used to parse the names...
- French 'De' is usually Title Case, while Dutch 'de' is usually lower case.
- More consistently, the Dutch name is coded Firstname-de, and the French De-Lastname
It'll do for now (the name coding isn't mission critical though I'd like it to be >99% accurate), and I'll have to spend some time looking at my algorithm.