Jump to content

scripts for removing names


Guest
 Share

This topic is 5766 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am dealing with importing a number of contact files into a single fp7 contact file I am working on, but unfortunately some of the files only have 1 (full) name field and don't have first and last name fields like the new file I am importing into.

After importing the full name into the First Name field, I created a simple looping script which copies the full name into the Last Name field as well, so I at least have automated getting the full name into BOTH fields.

Now I want to create a script for each field which removes either the last name in the case of the First Name field and the first name in the case of the Last Name field. Any suggestions?

Thanks!

Link to comment
Share on other sites

Hi Sean,

Names are tricky because there can be so many pieces:

Mrs. J. K. Murphy

Robert David Elliot, III

M. Michael Davidson, Sr.

E. Van Damne

Peggy Sue Van Dyke

Mr. Williamson, PhD

... and on it goes. Here's what I suggest: Create a calculation (number) with: WordCount(FirstName). If the result is two, you MIGHT be able to assume that it contains FirstName and LastName. But it MIGHT contain only first name (Betty Sue) or only LastName Van Dyke. To properly split this, it takes human eyeballs. Period. High-school students are great to hire for these types of projects. How much time you put into the process depends upon how important it is. I feel names are VERY important. Nothing irks a customer more than getting a letter addressed as:

Peggy Dyke (when first name is Peggy Sue and last name is Van Dyke) or Dear Mr. PhD. ... well, you get the picture. I would reinstate your FullName field until the parsing is complete AND keep it for history. Because you may wish to refer to it again. How would I do this process?

1) Create FullName text field.

2) Place cursor in FullName field. Replace Contents by calculation and enter FirstName in calc box. Now you've got your FullName history field back.

3) Put your cursor in FirstName field. Replace Contents by calculation and enter: LeftWords ( FirstName ; 1). Manually scroll the first names to be sure there are no Mr's or Dr's.

4) Put your cursor in LastName field. Replace Contents by calculation and enter: RightWords ( LastName ; 1 ). Manually scroll the last names to be sure there are no PhD's or MD's etc.

5) Now check to see if there is anything left over by creating calculation (number) with:

TrimAll ( FirstName & " " & LastName ; 0 ; 0 ) <> TrimAll ( FullName ; 0 ; 0 )

6) Search this field for 1. Manually review (and correct) them as needed.

You still may get some errors because of mistypes and such. For instance, E.L. Smith will produce 2 words (because User didn't enter a space between the initials). Actually, L is the middle initial but a regular parse will say his first name is E.L. I break name fields into 5 fields, examples are: 1) Mr., Mrs. Dr. 2) First name 3) Middle Name 4) Last Name 5) Sr., Jr., III, PhD etc... Then, once you have them split, don't let anyone ever talk you into combining them. :wink2:

And can ANY of these names be company names? Example: Bi-Mart becomes "Hello Bi" or Dear Mr. Mart ... it can get quite ugly. You can spend quite a bit of time creating a calculation to catch all the errors and you will NOT catch them all. Since it is a free-form entry field, there are just too many variations which only a human can properly interpret.

LaRetta

Link to comment
Share on other sites

Thanks for the reply, but this solution isn't in a script, so I am wondering if you can clarify some of this for me so I can try to create one.

I am fully aware of the need for checking that there are no double worded names and that one or two may in fact end up needing to be manually fixed later, however my assumption is that 99% of the names are not going to be an issue. Also, there are no instances of prefixes at all in these names the way they were entered, so Dr., Mr. or Ms. isn't a concern in this case.

Anyway, just trying to automate this as much as possible since I have various files being imported, with about 3500 records in total to contend with that need to be parsed. Thanks if you can suggest a script to me beyond the useful calculation suggestions.

BTW - for some reason the system keeps removing my profile, so the first posting listed as anonomous is really me with the profile missing. System administrators are working on this bug as I write this so hopefully I won't be removed again.

Edited by Guest
Link to comment
Share on other sites

I know, I should have tried it first, then commented - I was thinking too much about it. I just tried it to perfect results, and now have a something I didn't know about Filemaker in all of these years.

thanks!

Link to comment
Share on other sites

This topic is 5766 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Who Viewed the Topic

    1 member has viewed this topic:
    jjjjj 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.