Jump to content
Sign in to follow this  
Campus Club

Can I make FM7 move the first word from one field into a blank field?

Recommended Posts

Campus Club

I am working with a database that has been imported into FM7 and I have a first and last name field. Unfortunately many of the names are in the last name field only instead of being split between the two fields. What command can I use in a script to select the first word the 'last name' field and then move it into the blank 'first name' field?

Share this post


Link to post
Share on other sites
Maarten Witberg

Hi,

 

set field["first_name", "LeftWords(last_name;1)"]

 

should do it.

 

kjoe

smile.gif

Share this post


Link to post
Share on other sites
Campus Club

Yes, that moved the first name to the first name field, but it also left it behind in the last name field. How do I set it to delete the first name after that?

Share this post


Link to post
Share on other sites
Maarten Witberg

oh yes.

 

set field["last_name","RightWords(last_name;1"]

 

assuming you have no names like "John Stuart Mill, jr"

 

kjoe

smile.gif

Share this post


Link to post
Share on other sites
Campus Club

Ooh, that's the thing, I do have a lot of 3 or 4 part names. Is there anyway to just select that first word and then clear it or cut it?

Share this post


Link to post
Share on other sites
Maarten Witberg

set field["your_field", "Substitute(your_field;leftwords(your_field;1;"")"]

 

kjoe

smile.gif

Share this post


Link to post
Share on other sites
Inky Phil

Kjoe

is the substitute function above avaiable in FM5?

Phil

Share this post


Link to post
Share on other sites
Maarten Witberg

Hi Phil, I don't have 5.0, just 5.5, it is available in 5.5.

 

kjoe

smile.gif

Share this post


Link to post
Share on other sites
Inky Phil

I'll have a look

Many Thanks

Phil

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  



×
×
  • Create New...

Important Information

Terms of Use