dbTalk Databases Forums  

Using Leftword and the # character

comp.databases.filemaker comp.databases.filemaker


Discuss Using Leftword and the # character in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bubba
 
Posts: n/a

Default Using Leftword and the # character - 06-10-2011 , 05:18 PM






I have a text field wiht mutiple words in it. The text field might be
"12345678" or "123456789" or "1234567890" followed by a varying number
of spaces followed by the - character followed by 1 or more words.

I used the leftword command to separate the first word and it works
fine, except when the first word contains a "#" character, i.e.,
"12345678#AGM".

In this case it thinks the first word is "12345678" and not "12345678#AGM".

How do I get FIlemaker 11 to recognize the # as part of the first word.

TIA

Reply With Quote
  #2  
Old   
Hans Rijnbout
 
Posts: n/a

Default Re: Using Leftword and the # character - 06-10-2011 , 07:21 PM






Bubba <bubba (AT) mail (DOT) net> wrote:

Quote:
I used the leftword command to separate the first word and it works
fine, except when the first word contains a "#" character, i.e.,
"12345678#AGM".

In this case it thinks the first word is "12345678" and not "12345678#AGM".
Most punctuation marks act as word separators in Filemaker.
(Exceptions that I know of are the apostrophe (single quote) and the
period.)
So Leftwords(Substitute(text; "#"; ""); 1) should do the trick.

--
Hans Rijnbout
Utrecht, Netherlands

Reply With Quote
  #3  
Old   
Hans Rijnbout
 
Posts: n/a

Default Re: Using Leftword and the # character - 06-10-2011 , 07:34 PM



Hans Rijnbout <jrijnb (AT) xs4all (DOT) nl> wrote:

Quote:
Bubba <bubba (AT) mail (DOT) net> wrote:

I used the leftword command to separate the first word and it works
fine, except when the first word contains a "#" character, i.e.,
"12345678#AGM".

In this case it thinks the first word is "12345678" and not "12345678#AGM".

Most punctuation marks act as word separators in Filemaker.
(Exceptions that I know of are the apostrophe (single quote) and the
period.)
So Leftwords(Substitute(text; "#"; ""); 1) should do the trick.
That was too quick. You would want to put the # back again, so you
replace it with something unique and replace back:
Substitute(Leftwords(Substitute(text; "#"; "'"); 1); "'"; "#")
where "'" is a quoted single quote.



--
Hans Rijnbout
Utrecht, Netherlands

Reply With Quote
  #4  
Old   
Your Name
 
Posts: n/a

Default Re: Using Leftword and the # character - 06-10-2011 , 07:52 PM



In article <1k2oe0v.b1qh1lmhp0d6N%jrijnb (AT) xs4all (DOT) nl>, jrijnb (AT) xs4all (DOT) nl
(Hans Rijnbout) wrote:

Quote:
Bubba <bubba (AT) mail (DOT) net> wrote:

I have a text field wiht mutiple words in it. The text field might
be "12345678" or "123456789" or "1234567890" followed by a varying
number of spaces followed by the - character followed by 1 or more
words.

I used the leftword command to separate the first word and it works
fine, except when the first word contains a "#" character, i.e.,
"12345678#AGM".

In this case it thinks the first word is "12345678" and not
"12345678#AGM".

Most punctuation marks act as word separators in Filemaker.
(Exceptions that I know of are the apostrophe (single quote) and the
period.)

So Leftwords(Substitute(text; "#"; ""); 1) should do the trick.
Since the wanted text is always follwed by a space (it doesn't matter that
the number of them varies), then another way would be to simply take all
the characters up to, but excluding, the first space.
i.e.
Left (TextField; Position (TextField; " "; 1; 1) - 1)

I don't know if the Left / Position combination calculates any faster than
LeftWords / Substitute combination.

Helpful Harry )

Reply With Quote
  #5  
Old   
Bubba
 
Posts: n/a

Default Re: Using Leftword and the # character - 06-19-2011 , 03:22 PM



On 2011-06-10 17:52:54 -0700, Your Name said:

Quote:
I have a text field wiht mutiple words in it. The text field might
be "12345678" or "123456789" or "1234567890" followed by a varying
number of spaces followed by the - character followed by 1 or more
words.

I used the leftword command to separate the first word and it works
fine, except when the first word contains a "#" character, i.e.,
"12345678#AGM".

In this case it thinks the first word is "12345678" and not
"12345678#AGM".

Most punctuation marks act as word separators in Filemaker.
(Exceptions that I know of are the apostrophe (single quote) and the
period.)

So Leftwords(Substitute(text; "#"; ""); 1) should do the trick.

Since the wanted text is always follwed by a space (it doesn't matter that
the number of them varies), then another way would be to simply take all
the characters up to, but excluding, the first space.
i.e.
Left (TextField; Position (TextField; " "; 1; 1) - 1)

I don't know if the Left / Position combination calculates any faster than
LeftWords / Substitute combination.

Helpful Harry )
Thanks to both of you for the suggestion.

Reply With Quote
  #6  
Old   
Bubba
 
Posts: n/a

Default Re: Using Leftword and the # character - 06-19-2011 , 03:22 PM



On 2011-06-10 17:52:54 -0700, Your Name said:

Quote:
I have a text field wiht mutiple words in it. The text field might
be "12345678" or "123456789" or "1234567890" followed by a varying
number of spaces followed by the - character followed by 1 or more
words.

I used the leftword command to separate the first word and it works
fine, except when the first word contains a "#" character, i.e.,
"12345678#AGM".

In this case it thinks the first word is "12345678" and not
"12345678#AGM".

Most punctuation marks act as word separators in Filemaker.
(Exceptions that I know of are the apostrophe (single quote) and the
period.)

So Leftwords(Substitute(text; "#"; ""); 1) should do the trick.

Since the wanted text is always follwed by a space (it doesn't matter that
the number of them varies), then another way would be to simply take all
the characters up to, but excluding, the first space.
i.e.
Left (TextField; Position (TextField; " "; 1; 1) - 1)

I don't know if the Left / Position combination calculates any faster than
LeftWords / Substitute combination.

Helpful Harry )

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.