Jump to content

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

Recommended Posts

Posted

Hi all friends

they (FMI) said:

WordCount function

Format

WordCount(text)

Parameter

text - any text expression or text field

Data type returned

number

Description

Returns a count of the total number of words in text.

Examples

WordCount("The sun is rising.") returns 4.

WordCount(Letter) returns the total number of words in the Letter field.

Note The ampersand (&) and hyphen (-) characters identify the beginning of a new word.

But this: [email protected] is two words

and this: libero.it is one word

In the first example, with this calculation:

MiddleWords (text ; 1 ; 1 ) & "-" &MiddleWords (text ; 2 ; 1 )

I'll give:

raybaudi-libero.it

Where is gone the "@" ?

( so I think that there are more then two characters (ampersand (&) and hyphen (-)) that identify the beginning of a word; the only one that doesn't is the period (.))

What do you think about ?

Posted

The ampersand and hyphen are word delimiters - but they are not the only ones. There are many more, first and foremost a space, of course. I don't know if there's a comprehensive list, but at least !@#$%$%^*()=≠+/[]{}<>≤≥:P;`~|",? are all word delimiters.

The period CAN BE a word delimiter - depending on the last character of the preceding string and the first character of the following string:

If both characters are numeric, or both are alpha - the two strings are considered to be one word;

If one of the characters is alpha and the other is numeric, the period is considered a word delimiter:

one.two = 1 word

one.2 = 2 words

1.two = 2 words

1.2 = 1 word

The single quote character ' also has its own rules:

one'two = 1 word

one'2 = 2 words

1'two = 2 words

1'2 = 2 words

Word delimiters are not words, so you cannot get them with the MiddleWords() function.

Posted

Maybe if you used the Substitute function with the word count you can get what you want.

WordCount (Substitute (Substitute ( Text ; "." ; " " ); "@"; " " ))

HTH

Lee

Posted

Hi Lee

thank you.

But no, I didn't want to really count the words; I only found that what FMI says isn't complete !

The comment's reply is !

BTW that kind of problem come to me when I searched for a manner to grab an email address from a long generic text... I'll open a new topic in Custom Functions about it.

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