Jump to content

Text Function to strip first letter of every word.


jimkent
 Share

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

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)) & "

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This topic is 6522 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.