Jump to content

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

Recommended Posts

  • Newbies
Posted

I want to build a Calculation field which will look at another text field and extract (ie return) all upper case words of more than one character length found in the text field, and present the returned words as comma-separated. Eg:

AKYAB, CANARA, COMORIN, INDIA

Can anyone help? I am really stuck on writing the script for finding upper case words

John wink.gif" border="0

Posted

A calculation field could be very complicated. A script is much simpler:

code:


Set Field [gIndex,1]

Set Field [WordList, ""]

Loop

Exit Loop If [gIndex > WordCount(MyTextField)]

Set Field [gTestWord, MiddleWords(MyTextField,gIndex,1)]

If [Exact(gTestWord,Upper(gTestWord)) and Length(gTestWord)>1]

Set Field [WordList, WordList & ", " & gTestWord]

End If

Set Field [gIndex,gIndex+1]

End Loop


Field names starting with "g" are globals.

Posted

received by email:

quote:

I hope I'm not imposing on you but is there a way of adjusting the script so that it doesn't pick up numerals at the same time as identifying upper case words and ignores duplicates. I've tried for several hours to change the script so it does these things too, but without success. Again, any help you can give is greatly appreciated and if this is asking too much please say.

Regards

John Prescott

This is an example of the present script's result for the text field given below (by the way, I've changed the comma to a space and increased character count to >2) :

ARABIA BURMAH AUSTRALIAN SYDNEY 1863

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