Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Two questions. I'm not very good with FileMaker calculations...

If I'm givin a tab delimited file containing a field that has someones name as - Doe, John - How do I use a calculation to take that field and and reorder the users names to John, Doe? Also, how would I go about taking that field, and seperating both the last and first names into their own two fields? Not sure what functions to use or how to go about this.

Thanks in advance.

~Daniel

Posted

As long as the field always has the comma in it, it's easy:

LastName = Left(InputField;Position(InputField;",";1;1)-1)

FirstName = Middle(InputField; Position(InputField;",";1;1)+1;9999)

So:

FullName = FirstName & " " & LastName

Posted

I'd approach this job by creating a small FMP database to act as an import processing file: the tab-delimited data gets imported into the FMP database and get turned into records and fields. Re-ordering the rows then becomes a matter of sorting the records.

Splitting names is always a problem, because not all entries follow the "firstname lastname" format where the first and last names are one word each.

How would you split "Mary Anne Smith" and "Vince De Saul"?

If the name field has only two words then it's easy. But if there are more than two words human intevention will probably be necessary. We can still make a guess and say that the last word is the surname: all the rest is the first name.

LastName = RightWords( namefield ; 1 )

FirstName = LeftWords( namefield ; WordCount( namefield ) - 1 )

I'd make a calc field that counted all the words in the name field, then find all those records with more than 2 words and process them by hand.

This topic is 7199 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.