Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted (edited)

First, I am sorry that this is most definitely a repeated topic and probably pretty common, however, I could not find it in this forum or on the internet and had to post the question.

I am stuck with a mailing list that has 13,000 names set up with "Last Name, First Name," which obviously needs to become First Name (Space) Last name with no comma.

This name field contains all of the headaches associated with people's names. Examples as follows:

Smith, Bob

Smith Jr., Bob

Smith-Wesson Jr., Bob

Smith Wesson IV, Bob Peter

 

The good news, is that the list is solid with the respect that the there is only ONE comma. I need to simply reverse this order and delete the comma.

 

Thank you in advance! This is a wonderful community and I wracked my brains on this now for too long and need your help!

 

Mike

 

 

 

Edited by MacFileman
Name Edits
Posted
6 minutes ago, MacFileman said:

The good news, is that the list is solid with the respect that the there is only ONE comma.

That is indeed good news. I would suggest you extract the parts into two separate fields. Then you will be able to easily recombine them in any way you wish.

Use =

Left ( FullName ; Position ( FullName ; ", " ; 1 ; 1 ) - 1 )

to extract the last name, and =

Right ( FullName ; Length ( FullName ) - Position ( FullName ;  ", " ; 1 ; 1 ) - 1 )

to extract the first.

 

  • Thanks 1
Posted

Thanks for the fast response....

 

Ok... the left works well! The right is not working. It does not recognize "LENGTH" and I get an error in my calculation. Not sure what value to place there.

Posted

Give me 5 minutes... will post my file. Due to sensitivity, need to remove actual address and I will shorten the list. : )

Posted

So the left works perfect... right is now "Can not find field?"

LEFT GOOD.png

RIGHT BAD.png

I changed all "Full name" to "supplied name"

SMH.... I quit filemaker and restarted. YOUR CALCULATION WORKS!

 

 

OMG THANKS!!!!

THIS DOES WORK PERFECTLY!! No idea why it didn't;t work the first time. But I quit the app... walked away, came back and it worked.

 

Posted

There should be a highlight on the problematic part. Without seeing that, it's hard to say. You could have picked a gremlin character when copying here. Try typing it in manually. Or go through a text editor that can show invisible characters.

Posted

I can not thank you enough!!

While I am here though, I am trying to understand the code. I do not do this everyday like you might, but I have done some powerful programs with filmmaker. 

Mostly, I am trying to understand what the 

; 1 ; 1 ) - 1 )

What that means in this calculation at the end here.

Posted (edited)

You have to parse this like you would a math expression - from the parentheses outward. First you find the position of the comma:

Position ( FullName ;  ", " ; 1 ; 1 )

Then you subtract that from the overall length of the full name to get the count of characters on the right side of the comma. And you have to subtract 1 to account for the space after the comma.

 

Edited by comment
  • Like 2
Posted

Just an alternative that I've used in similar situations, which I find more readable and understandable:

First Name:

GetValue ( Substitute ( SUPPLIED NAME ; ", " ; "¶" ) ; 2 )

Last Name:

GetValue ( Substitute ( SUPPLIED NAME ; ", " ; "¶" ) ; 1 )

Converting text delimited with a specific string to a list often makes parsing it much easier.

  • Like 1

This topic is 2206 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
×
×
  • Create New...

Important Information

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