Middle Words & Numbers

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Middle Words & Numbers

Ben Levitan LLC

I'm trying to get the fifth word out of this string:




139353316 544348 -100.49633 28.72745 -1 -1.0


I expect to get -1, but I keep getting 1.  I'm using middlewords and have the function set to "Text".  What's up?



Ben


sent from my IBM Selectric Typewriter
____________________________________________________




_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Middle Words & Numbers

Darren Terry-3
Hi Ben: A dash is a word separator in FM.

> On Jun 12,2017, at 11:37 AM, Ben Levitan LLC <[hidden email]> wrote:
>
>
> I'm trying to get the fifth word out of this string:
>
>
>
>
> 139353316 544348 -100.49633 28.72745 -1 -1.0
>
>
> I expect to get -1, but I keep getting 1.  I'm using middlewords and have the function set to "Text".  What's up?



regards,
Darren

******************************
 Darren Terry
 Pacific Data Management, Inc.
 FileMaker Certified Developer
 Phone: (408) 283-5900 x7003
 Fax: (408) 283-5903
 [hidden email]
 http://www.pdm-inc.com/

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Middle Words & Numbers

Bob Gossom
In reply to this post by Ben Levitan LLC
Ben,

Try this:
getasnumber(
trim(middle(
file::text,
position(file::text," ", 1, 4),
position(file::text," ", 1, 5)-position(file::text," ", 1, 4)
)
)
)

Could clean it up with a let. Assumes consistent data, particularly regarding spaces.

Bob Gossom
Absolute Advantage, Inc.
(818) 718-2027
mobile: (818) 917-3528





> On Jun 12, 2017, at 11:37 AM, Ben Levitan LLC <[hidden email]> wrote:
>
>
> I'm trying to get the fifth word out of this string:
>
>
>
>
> 139353316 544348 -100.49633 28.72745 -1 -1.0
>
>
> I expect to get -1, but I keep getting 1.  I'm using middlewords and have the function set to "Text".  What's up?
>
>
>
> Ben
>
>
> sent from my IBM Selectric Typewriter
> ____________________________________________________
>
>
>
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Middle Words & Numbers

Darren Terry-3
In reply to this post by Ben Levitan LLC
Hi Ben:

Or, try this:

Let ( x = Substitute ( "139353316 544348 -100.49633 28.72745 -1 -1.0” ; “ “ ; “¶” ) ;

GetValue ( x ; 5 )

)


> On Jun 12,2017, at 11:37 AM, Ben Levitan LLC <[hidden email]> wrote:
>
>
> I'm trying to get the fifth word out of this string:
>
>
>
>
> 139353316 544348 -100.49633 28.72745 -1 -1.0
>
>
> I expect to get -1, but I keep getting 1.  I'm using middlewords and have the function set to "Text".  What's up?



regards,
Darren

******************************
 Darren Terry
 Pacific Data Management, Inc.
 FileMaker Certified Developer
 Phone: (408) 283-5900 x7003
 Fax: (408) 283-5903
 [hidden email]
 http://www.pdm-inc.com/

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Middle Words & Numbers

Stefan Schütt
In reply to this post by Ben Levitan LLC
Hi Ben,

> Ben Levitan LLC <[hidden email]> kirjoitti 12.6.2017 kello 21.37:
>
> I'm trying to get the fifth word out of this string:
>
>
>
>
> 139353316 544348 -100.49633 28.72745 -1 -1.0
>
>
> I expect to get -1, but I keep getting 1.  I'm using middlewords and have the function set to "Text".  What's up?

Maybe you could first do a substitute to get the string seprated into lines.

Let(
theString= Substitute(139353316 544348 -100.49633 28.72745 -1 -1.0;” ”;”¶”)
;
GetValue(theString;5)
)

This will give you -1.

HTH
__
Stefan Schutt, Mouse Up, Finland



_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Middle Words & Numbers

Bob Gossom
In reply to this post by Darren Terry-3
I like Darren’s method…

Bob Gossom
Absolute Advantage, Inc.





> On Jun 12, 2017, at 11:55 AM, Darren Terry <[hidden email]> wrote:
>
> Hi Ben:
>
> Or, try this:
>
> Let ( x = Substitute ( "139353316 544348 -100.49633 28.72745 -1 -1.0” ; “ “ ; “¶” ) ;
>
> GetValue ( x ; 5 )
>
> )
>
>
>> On Jun 12,2017, at 11:37 AM, Ben Levitan LLC <[hidden email]> wrote:
>>
>>
>> I'm trying to get the fifth word out of this string:
>>
>>
>>
>>
>> 139353316 544348 -100.49633 28.72745 -1 -1.0
>>
>>
>> I expect to get -1, but I keep getting 1.  I'm using middlewords and have the function set to "Text".  What's up?
>
>
>
> regards,
> Darren
>
> ******************************
> Darren Terry
> Pacific Data Management, Inc.
> FileMaker Certified Developer
> Phone: (408) 283-5900 x7003
> Fax: (408) 283-5903
> [hidden email]
> http://www.pdm-inc.com/
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Middle Words & Numbers

Stefan Schütt
In reply to this post by Stefan Schütt
Ben,

> Stefan Schütt <[hidden email]> kirjoitti 12.6.2017 kello 21.58:
>
> This will give you -1.

Heh, Darren beat me to it. :-)
__
Stefan Schutt, Mouse Up, Finland



_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Middle Words & Numbers

Ben Levitan LLC
In reply to this post by Darren Terry-3
Guys,
That worked.  Thanks.  


I need to get different values off this string so I did this approach for all the values just changing the index number I was looking for.
Why doesn't MiddleWords work?  I did some experiments and it is inconsistent.  


Thanks!!



Ben


sent from my IBM Selectric Typewriter
____________________________________________________






-----Original Message-----
From: Darren Terry <[hidden email]>
To: Filemaker Experts <[hidden email]>
Sent: Mon, Jun 12, 2017 2:55 pm
Subject: Re: Middle Words & Numbers

Hi Ben:

Or, try this:

Let ( x = Substitute ( "139353316 544348 -100.49633 28.72745 -1 -1.0” ; “ “ ; “¶” ) ;

GetValue ( x ; 5 )

)


> On Jun 12,2017, at 11:37 AM, Ben Levitan LLC <[hidden email]> wrote:
>
>
> I'm trying to get the fifth word out of this string:
>
>
>
>
> 139353316 544348 -100.49633 28.72745 -1 -1.0
>
>
> I expect to get -1, but I keep getting 1.  I'm using middlewords and have the function set to "Text".  What's up?



regards,
Darren

******************************
 Darren Terry
 Pacific Data Management, Inc.
 FileMaker Certified Developer
 Phone: (408) 283-5900 x7003
 Fax: (408) 283-5903
 [hidden email]
 http://www.pdm-inc.com/

_______________________________________________FMPexperts mailing [hidden email]://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Middle Words & Numbers

Ben Levitan LLC
In reply to this post by Darren Terry-3
Thanks, Darren!  Another useful fact I have to keep in my brain.  It might be useful as a feature someday.

Hi Ben: A dash is a word separator in FM.




Ben Levitan
sent from my IBM Selectric Typewriter
____________________________________________________






-----Original Message-----
From: Darren Terry <[hidden email]>
To: Filemaker Experts <[hidden email]>
Sent: Mon, Jun 12, 2017 2:41 pm
Subject: Re: Middle Words & Numbers

Hi Ben: A dash is a word separator in FM.

> On Jun 12,2017, at 11:37 AM, Ben Levitan LLC <[hidden email]> wrote:
>
>
> I'm trying to get the fifth word out of this string:
>
>
>
>
> 139353316 544348 -100.49633 28.72745 -1 -1.0
>
>
> I expect to get -1, but I keep getting 1.  I'm using middlewords and have the function set to "Text".  What's up?



regards,
Darren

******************************
 Darren Terry
 Pacific Data Management, Inc.
 FileMaker Certified Developer
 Phone: (408) 283-5900 x7003
 Fax: (408) 283-5903
 [hidden email]
 http://www.pdm-inc.com/

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au