Text Parsing with Filemaker - parsing names with example scripts
Parsing Like a Pro
Published onApril 29, 2011byMartha Zink
Extracting Title, First, Middle, and Last Name from a Single Field
Answer ID: 3638Last Updated: Feb 27, 2012
SNIP If you would like to have a period after initials and appropriate titles and suffixes, add the following fields WITHOUT deleting the corresponding fields from Define Fields. Use these new fields on your layout instead of Title, FirstName, MiddleName, and Suffix above.
Title. (Calculation, text result)= If(title = "miss", title, title & ".")
First (Calculation, text result)= If(Length(FirstName) = 1, FirstName & ".", FirstName)
Middle (Calculation, text result)= If(Length(MiddleName) = 1, MiddleName & ".", MiddleName)
Suffix. (Calculation, text result)= If(Suffix = "jr" or Suffix = "sr" or Suffix ="esq", Suffix & ".", Suffix)
Explains symbols that are considered word breaks like the period
LeftWord is not deleting the period. It not included because a period is consider punctuation and not part of the word. You could modify DavidAnders Title Example and add Inc.
In your function, doesn't Beans Inc. result in just the first word: "Beans" being returned? As I read your If statement, if there is a period in the function, it returns the single, leftmost word--which will leave off more than just the period.
If your are actually using this expression:
If ( Position ( vnname ; ","; 1; 1) ≠ 0;LeftWords(vnname; 8);LeftWords ( vnname ; 1 ))
Then you can modify it to be:
If ( Position ( vnname ; ","; 1; 1) ≠ 0;LeftWords(vnname; 8) & "." ; LeftWords ( vnname ; 1 ))
Hi everyone, and thank you very much for your input.
Unfortunately the period appears in a name that is not a typical "LLC", or "INC."
And Phil the script is looking for a coma not a period as most of the FN, LN text is seperated with a coma, sorry it's hard to see :-). I beleive your script would put a period after every LeftWords.
What I need is for the LeftWords function to not ignore the period, I know this is stupid design but it is what I have to work with.
The actual text is "STOEGER IND." and it is the only record that appears like this :-(
Any further help would be greatly appreciated
Actually I found a solution by using PatternCount to look for a period in the file.
Thank you all for your very helpful input.