Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Text Function to strip first letter of every word.


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

Recommended Posts

Posted

Does anyone have a quicky way to get the first letter of every word of a string? My client insists on using a serial number with letters that represent the product. So, I need to take a string which could be 1, 2 or more words and take the first letter of every word and concatenate it with a incrementing serial number. i.e. Georgia Bulldogs = GB001, or Alabama Crimson Tide= ACT001 and so on. Any thoughts?

Version: Developer v6

Platform: Windows XP

Posted

Here's one method. Just add your serial to the vlInitials field, and use a script to set a field with the result, if you need to have this field indexed.

Kent.zip

Posted

Ok, looked at the attachment. Sorry, but still confused. Could you explain the significance of the repeating fields and the relationships you did? I my customer has 4000 records or so. I can't make a repeating field for that long. Couldn't I do this without the repeating field? Sorry about the confusion. Thanks

Posted

The repeating calculation field is specific to each record with a maximum (in the example) of 20 words. You can add/remove repetitions if you'll only have a max of 5 words per string or 25 words, etc. The repeating global index simply contains the consecutive numbers 1 - 20. The constant self-relationship is used to lookup the global index into a number field so that it can be indexed.

The calculated repetition then uses this index to determine what value should result for each repetition. For the first five repetitions, Case(WordCount(Extend(text)) >= repIndex, Left(MiddleWords(Extend(text), repIndex, 1), 1)) would be similar to

Case(WordCount(text) >= 1, Left(MiddleWords(text, 1, 1), 1)) & "

Posted

ah ha... Now this makes sense. Thanks so much... With regard to the serial numbers, the client only said that they use the incrementing numbers from each team name. in other words, if a team (Georgia Bulldogs) had 50 products, and another team (Northern Illinois Huskies) had 100 products, we would have serial numbers of GB050 and NIH100 repectively. So the next product for each team would be GB051 and NIH101. I'm not sure if this is easily done, if not, I don't see a problem with just adding a generalized record number to the Initials, After all, I don't think it will ever run into a repeat. If we do it like my client asks, if we have a team with the same initials, we will have the same serial number... NOT GOOD! I'll have to talk them out of their thoughts. Thanks so much for your help!

Posted

Then it would probably be easiest to create an auto-enter serial and append it to the end of the vlInitials calculation.

The pleasure is mine. cool.gif

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