dbTalk Databases Forums  

What is a word?

comp.databases.filemaker comp.databases.filemaker


Discuss What is a word? in the comp.databases.filemaker forum.



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

Default What is a word? - 12-11-2005 , 08:56 PM






I have the following return-separated values (they are file names) in a
field:

HOME.QDF
HOME.QEL
HOME.QPH
HOME.QSD
Q3.DIR

Using MiddleWords ( Field ; Num ; 1 ) I can parse a value from the
list, depending on the value of Num. I'm using MiddleWords instead of
MiddleValues so as to get just the file name in the parsed value,
without the line-end return.

When Num = 1 through 4, I get the entire file name: "Home.***".

When Num = 5, all I get is "Q3". The file extension (including the dot)
is not picked up.

Turns out that the MiddleWords function is treating Q3 and DIR as
separate words. It makes no difference what line "Q3.DIR" is on.

It would appear that there is something about "DIR" that the function
doesn't like. Help says nada.

Any thoughts?

Matt

Reply With Quote
  #2  
Old   
Matt Wills
 
Posts: n/a

Default Re: What is a word? - 12-11-2005 , 09:10 PM






Matt Wills wrote:

Quote:
I have the following return-separated values (they are file names) in
a field:

HOME.QDF
HOME.QEL
HOME.QPH
HOME.QSD
Q3.DIR

Using MiddleWords ( Field ; Num ; 1 ) I can parse a value from the
list, depending on the value of Num. I'm using MiddleWords instead of
MiddleValues so as to get just the file name in the parsed value,
without the line-end return.

When Num = 1 through 4, I get the entire file name: "Home.***".

When Num = 5, all I get is "Q3". The file extension (including the
dot) is not picked up.

Turns out that the MiddleWords function is treating Q3 and DIR as
separate words. It makes no difference what line "Q3.DIR" is on.

It would appear that there is something about "DIR" that the function
doesn't like. Help says nada.

Any thoughts?

Matt
Addendum:

In Help, entries for LeftWords, MiddleWords and RightWords say that &
and - (ampersand and hyphen) mark the beginning of a new word.

Hmmm. The examples all use words that are separated by spaces.

Seems line end works too, but nothing is said about . (period/dot).

Oh, by the way, FMD7/WXP.

Matt

--



Reply With Quote
  #3  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: What is a word? - 12-11-2005 , 10:21 PM



You may try to add to YrField a 'return' at the end, ie YrField2 =
YrField & "P" ("P" is the 'return'), and work on YrField2.
You may also try to use first 'Middle' to replace the "." (dot) by a
space or something ("$$" ?) in YrField2, then parse and replace back
your "$$" by dots.
Etc.
Remi-Noel


"Matt Wills" <Im (AT) Witz (DOT) End> a écrit :
Quote:
I have the following return-separated values (they are file names) in
a field:

HOME.QDF
HOME.QEL
HOME.QPH
HOME.QSD
Q3.DIR

Using MiddleWords ( Field ; Num ; 1 ) I can parse a value from the
list, depending on the value of Num. I'm using MiddleWords instead of
MiddleValues so as to get just the file name in the parsed value,
without the line-end return.

When Num = 1 through 4, I get the entire file name: "Home.***".

When Num = 5, all I get is "Q3". The file extension (including the
dot) is not picked up.

Turns out that the MiddleWords function is treating Q3 and DIR as
separate words. It makes no difference what line "Q3.DIR" is on.

It would appear that there is something about "DIR" that the function
doesn't like. Help says nada.

Any thoughts?

Matt

Addendum:

In Help, entries for LeftWords, MiddleWords and RightWords say that &
and - (ampersand and hyphen) mark the beginning of a new word.

Hmmm. The examples all use words that are separated by spaces.

Seems line end works too, but nothing is said about . (period/dot).

Oh, by the way, FMD7/WXP.

Matt

--




Reply With Quote
  #4  
Old   
Dan Fretwell
 
Posts: n/a

Default Re: What is a word? - 12-12-2005 , 03:39 AM



The problem is the "3.". As a quick test I have done a WordCount on
Home.QDF and Home1.qdf. In the first case the result is 1 and in the
second case the result is 2. On the other hand Ho1me.qdf returns 1 but
Ho1.me.qdf returns 2. Replace these periods by commas and the count
rises to 3. I don't know if this is covered in the help, I couldn't
find it. But for some reason periods and commas are treated differently
in counting words and preceding a period by a digit seems to mark the
end of a word.


Reply With Quote
  #5  
Old   
Matt Wills
 
Posts: n/a

Default Re: What is a word? - 12-12-2005 , 03:54 AM



Remi-Noel Menegaux wrote:

Quote:
You may try to add to YrField a 'return' at the end, ie YrField2 =
YrField & "P" ("P" is the 'return'), and work on YrField2. You may
also try to use first 'Middle' to replace the "." (dot) by a space or
something ("$$" ?) in YrField2, then parse and replace back your "$$"
by dots. Etc. Remi-Noel


"Matt Wills" <Im (AT) Witz (DOT) End> a icrit :

I have the following return-separated values (they are file
names) in a field:

HOME.QDF
HOME.QEL
HOME.QPH
HOME.QSD
Q3.DIR

Using MiddleWords ( Field ; Num ; 1 ) I can parse a value from the
list, depending on the value of Num. I'm using MiddleWords
instead of MiddleValues so as to get just the file name in the
parsed value, without the line-end return.

When Num = 1 through 4, I get the entire file name: "Home.***".

When Num = 5, all I get is "Q3". The file extension (including the
dot) is not picked up.

Turns out that the MiddleWords function is treating Q3 and DIR as
separate words. It makes no difference what line "Q3.DIR" is on.

It would appear that there is something about "DIR" that the
function doesn't like. Help says nada.

Any thoughts?

Matt

Addendum:

In Help, entries for LeftWords, MiddleWords and RightWords say that
& and - (ampersand and hyphen) mark the beginning of a new word.

Hmmm. The examples all use words that are separated by spaces.

Seems line end works too, but nothing is said about . (period/dot).

Oh, by the way, FMD7/WXP.

Matt

--


--



Reply With Quote
  #6  
Old   
Matt Wills
 
Posts: n/a

Default Re: What is a word? - 12-12-2005 , 04:08 AM



Dan Fretwell wrote:

Quote:
The problem is the "3.". As a quick test I have done a WordCount on
Home.QDF and Home1.qdf. In the first case the result is 1 and in the
second case the result is 2. On the other hand Ho1me.qdf returns 1 but
Ho1.me.qdf returns 2. Replace these periods by commas and the count
rises to 3. I don't know if this is covered in the help, I couldn't
find it. But for some reason periods and commas are treated
differently in counting words and preceding a period by a digit seems
to mark the end of a word.
and

Remi-Noel Menegaux wrote:

Quote:
You may try to add to YrField a 'return' at the end, ie YrField2 =
YrField & "P" ("P" is the 'return'), and work on YrField2. You may
also try to use first 'Middle' to replace the "." (dot) by a space or
something ("$$" ?) in YrField2, then parse and replace back your "$$"
by dots. Etc. Remi-Noel
There is a return at the end of the list.

Contrary to the Help (only & and - supoosedly specifically mark the
beginning of a new word) it appears that anything that's not a letter
does that, with exception of the ".", but then only sometimes.

So how about the most obvious: a space?

Substitue spaces for the dots in the original list, and I have this:

HOME QDF
HOME QEL
HOME QPH
HOME QSD
Q3 DIR

Using MiddleWords to pick out a group of two words at a time, I replace
the space in that value with a dot, and I have the proper string back.

Somewhat roundabout, but it works.

Thanks for the help.

Matt



Reply With Quote
  #7  
Old   
Dan Fretwell
 
Posts: n/a

Default Re: What is a word? - 12-12-2005 , 07:23 AM



There is an assumption built into this that a filename will never
contain two words and in particular no spaces or more than one period,
if that can be guaranteed then you will have no problem.

Going back to your first post I would have thought the simpext solution
would be to use MiddleValues and remove the final carriage return - I
think that all FMP functions which return a Value always return with a
final carriage return.

So the filenames are obtained by
Left(MiddleValues(Field;num;1);Length(MiddleValues (Field;num;1)) - 1).


Reply With Quote
  #8  
Old   
Matt Wills
 
Posts: n/a

Default Re: What is a word? - 12-12-2005 , 04:41 PM



Dan Fretwell wrote:

Quote:
There is an assumption built into this that a filename will never
contain two words and in particular no spaces or more than one period,
if that can be guaranteed then you will have no problem.
In this case, it is a little app I am building for myself, nothing moe
than using FileMaker with oAzium FileTools to copy the contents of a
specific directory. No problem with what the filenames will be.

Quote:
Going back to your first post I would have thought the simpext
solution would be to use MiddleValues and remove the final carriage
return - I think that all FMP functions which return a Value always
return with a final carriage return.

So the filenames are obtained by
Left(MiddleValues(Field;num;1);Length(MiddleValues (Field;num;1)) - 1)
I have it working fine with first substituting a sapce for the dot,
taking two words, then re-substituting the space with a dot.

It the interest of sinplification, though, and against the possibility
that I may need the technique sometime in the future with unknown
filenames, I will certainly give it a shot.

Thanks.

Matt



--



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.