Joe Harkins Posted December 21, 2007 Posted December 21, 2007 Solution: parse names Description: I've searched through the forums (honestly) but can't find the script to parse an imported file with names such as BAKER, ANGELA W. & CARL BARBER, JOE into Angela & Joe Baker Joe Barber Case conversion would be a wonderful bonus but I am desperate for the name parse. Working Under: Solution Status: Finished Pre-requisites: Author(s): Joe Harkins Date: 12/21/07 Credits: Instructions / Other Info: Disclaimer: FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.
CobaltSky Posted December 21, 2007 Posted December 21, 2007 Your question is pretty unclear, Joe. First of all, you provide a list of only two names and you don't say whether the rest of the names you will be importing are all formatted like one or other of the examples. Second, we are probably meant to assume that the two lines in your example refer to the contents of a name field in two separate records, but you don't actually say this. Thirdly, the subtext to your post refers to FileMaker 6, but the sidebar says you are using Dev7. If you really need to do this in v6 it would be appropriate to draw attention to the fact in your question - especially since the code for v6 will be quite different from v7 (and because v6 is five years out of date...). And that is not including the fact that you seem to be asking for a Joe Baker in the results, but there is no Joe Baker in the example import text you've provided. Perhaps we are to guess that you meant Carl Baker? If you are hoping folk will go out of their way to help you, it might not hurt if you were to provide enough information to ensure your question will be interpreted accurately. :wink2:
Joe Harkins Posted December 21, 2007 Author Posted December 21, 2007 BTW - In searching through things here I was amused to see that someone has posted a tip for creating multiple layered and tabbed fields under their own name as if they created it. I published that about 12 years ago in a long defunct FileMaker Pro newsletter.
CobaltSky Posted December 21, 2007 Posted December 21, 2007 I imagine what you are looking for is a calc formula along the lines of: [color:blue]Proper( LeftWords( Right(NameField, Length(NameField) - Position(NameField, ", ", 1, 1) - 1), 1)) & If(Position(NameField, "& ", 1, 1), " & " & Proper( LeftWords( Right(NameField, Length(NameField) - Position(NameField, "& ", 1, 1) - 1), 1)) & " ", " ") & Proper( Left(NameField, Position(NameField, ", ", 1, 1) - 1)) ...where the original field the names are imported into is called NameField.
Joe Harkins Posted December 21, 2007 Author Posted December 21, 2007 Thank you. I'll give that a try. BTW - If you are a jazz fan, as so many Aussie are, keep your eye open for John Harkins, one of my sons. He lives in Manly but plays at all the jazz festivals and tours with other performers too. He also plays Melbourne a few times a year. Thanks again for your help.
Joe Harkins Posted December 21, 2007 Author Posted December 21, 2007 (edited) Sorry, it's been so long since I've used FM - and scripting was never a strong point - I'm missing something that is probably pretty obvious . . . I have a Excel file with the field, Owner, that contains the text to be parsed when imported into the FM solution. Also, I have a field, in the FM solution, called OwnerName, into which I intend to import the owner name and want it parsed as discussed. And I have created a new text field, NameField into which the results of the calculation on OwnerName willbe placed. Question: Do I make OwnerName the calculated field? Importing into it will result in parsing its content into NameField? But, I can't do that because OwnerName cannot be imported into. As a calc field it is grayed out in the import dialog. Sorry for being so dense. What am I doing wrong? Edited December 21, 2007 by Guest
The Big Bear Posted December 21, 2007 Posted December 21, 2007 Joe You import the name into a text field and the calculated field will produced the results you want.
Joe Harkins Posted December 21, 2007 Author Posted December 21, 2007 So, in the above scenario, OwnerName is the text field into which I import NameField is the results field (also text) What field is defined as the calculated field? And what causes the calculations to launch? I don't understand how simply importing text from an extranal file into OwnerName would launch the calculations and cause it to put the result in Name Filed. Wouldn't that require a script?
Joe Harkins Posted December 21, 2007 Author Posted December 21, 2007 (edited) OK, your answer left out the DUH factor (Dumb User Handicap) that applies to me. I went back and read the responses much more carefully (OK, I read them carefully for the first time), created an import-dedicated calculated field called CalcField, imported the external into NameField and it worked beautifully. I really appreciate the excellent help! i'd like to play with the calc so I can learn. Which part of the above calc converts the FULL CAPS to Initial Caps? I'd like to learn how to write the calc to convert the other parts of the address (Street, City, State and Zip) to Initial Caps. Edited December 21, 2007 by Guest
The Big Bear Posted December 22, 2007 Posted December 22, 2007 The function called "Proper" will capital the first Letter of the Word.
Recommended Posts
This topic is 6180 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 accountSign in
Already have an account? Sign in here.
Sign In Now