How to copy everything after a : ???

  • Follow


I have a couple string fields that I want to copy into new fields but I want
to exclude everything that comes before (and including) a colon :

Type :   Basic
Time Frame :   Very Soon
Assessment :  Pending

The number of words before and after the colon can very so I can't use the
RightWords function.

Is there a way to copy everything on a line after a specific character?

Mike


0
Reply zaqq1111 2/29/2004 3:50:47 AM

"Matt Wills" <Im@Witz.end> a �crit dans le message de
news:gXb0c.7699$qX5.545@nwrdny03.gnilink.net...
> If  there is a uiniform number of spaces after the colon, use the Right
> function, with the Position function telling Right where to start. You're
> actually counting from the right, so subtract however many positions to
> delete spaces after the colon:
>
> Converted = Right(Original,Position( Original, ":", 1, 1)-1)
>
> If the number of spaces is not uniform, forget the position adjustment and
> use Trim to get rid of them:
>
> Converted = Trim( Right( Original, Position( Original, ":", 1, 1)))

Hello,

Sorry to jump in, but this won't work. Accordind to Filemaker's online help,
the Right function "returns the specified number of characters in the
supplied text, counting from the right". So the second parameter doesn't
specify where it starts, but rather the lenght of the string to extract.

The proper cauculation is:
Converted = Trim(Right(Original , Length(Original) - Position( Original,
":", 1, 1)))

Marc-Andr� Paiement









>
> Matt
>
> <zaqq1111@yahoo.com> wrote in message
> news:v42dnbU-toAxqtzdRVn-hA@wideopenwest.com...
> >
> > I have a couple string fields that I want to copy into new fields but I
> want
> > to exclude everything that comes before (and including) a colon :
> >
> > Type :   Basic
> > Time Frame :   Very Soon
> > Assessment :  Pending
> >
> > The number of words before and after the colon can very so I can't use
the
> > RightWords function.
> >
> > Is there a way to copy everything on a line after a specific character?
> >
> > Mike
> >
> >
>
>


0
Reply Marc 2/29/2004 8:14:06 PM


Yup, you're right.

Didn't test enough. It worked OK on the first couple of examples, and I left
it there.

Matt

"Marc-Andr� Paiement" <mapaie@cgocable.ca> wrote in message
news:iKr0c.89941$2g.54949@charlie.risq.qc.ca...
>
> "Matt Wills" <Im@Witz.end> a �crit dans le message de
> news:gXb0c.7699$qX5.545@nwrdny03.gnilink.net...
> > If  there is a uiniform number of spaces after the colon, use the Right
> > function, with the Position function telling Right where to start.
You're
> > actually counting from the right, so subtract however many positions to
> > delete spaces after the colon:
> >
> > Converted = Right(Original,Position( Original, ":", 1, 1)-1)
> >
> > If the number of spaces is not uniform, forget the position adjustment
and
> > use Trim to get rid of them:
> >
> > Converted = Trim( Right( Original, Position( Original, ":", 1, 1)))
>
> Hello,
>
> Sorry to jump in, but this won't work. Accordind to Filemaker's online
help,
> the Right function "returns the specified number of characters in the
> supplied text, counting from the right". So the second parameter doesn't
> specify where it starts, but rather the lenght of the string to extract.
>
> The proper cauculation is:
> Converted = Trim(Right(Original , Length(Original) - Position( Original,
> ":", 1, 1)))
>
> Marc-Andr� Paiement
>
>
>
>
>
>
>
>
>
> >
> > Matt
> >
> > <zaqq1111@yahoo.com> wrote in message
> > news:v42dnbU-toAxqtzdRVn-hA@wideopenwest.com...
> > >
> > > I have a couple string fields that I want to copy into new fields but
I
> > want
> > > to exclude everything that comes before (and including) a colon :
> > >
> > > Type :   Basic
> > > Time Frame :   Very Soon
> > > Assessment :  Pending
> > >
> > > The number of words before and after the colon can very so I can't use
> the
> > > RightWords function.
> > >
> > > Is there a way to copy everything on a line after a specific
character?
> > >
> > > Mike
> > >
> > >
> >
> >
>
>


0
Reply Matt 2/29/2004 8:36:44 PM

My understanding was that Mike wanted to grab one line's worth at a 
time.  This would look like:

Where SearchField = "Type :" ...

middle(OrigText,
    position(OrigText, SearchField, 1, 1) + length(SearchField) + 1),
    position(OrigText, "�", position(OrigText, SearchField, 1, 1), 1) + 
length(SearchField) + 1), 1) - (position(OrigText, SearchField, 1, 1) + 
length(SearchField) + 1))



Marc-Andr� Paiement wrote:

> "Matt Wills" <Im@Witz.end> a �crit dans le message de
> news:gXb0c.7699$qX5.545@nwrdny03.gnilink.net...
> 
>>If  there is a uiniform number of spaces after the colon, use the Right
>>function, with the Position function telling Right where to start. You're
>>actually counting from the right, so subtract however many positions to
>>delete spaces after the colon:
>>
>>Converted = Right(Original,Position( Original, ":", 1, 1)-1)
>>
>>If the number of spaces is not uniform, forget the position adjustment and
>>use Trim to get rid of them:
>>
>>Converted = Trim( Right( Original, Position( Original, ":", 1, 1)))
> 
> 
> Hello,
> 
> Sorry to jump in, but this won't work. Accordind to Filemaker's online help,
> the Right function "returns the specified number of characters in the
> supplied text, counting from the right". So the second parameter doesn't
> specify where it starts, but rather the lenght of the string to extract.
> 
> The proper cauculation is:
> Converted = Trim(Right(Original , Length(Original) - Position( Original,
> ":", 1, 1)))
> 
>>
>><zaqq1111@yahoo.com> wrote in message
>>news:v42dnbU-toAxqtzdRVn-hA@wideopenwest.com...
>>
>>>I have a couple string fields that I want to copy into new fields but I
>>
>>want
>>
>>>to exclude everything that comes before (and including) a colon :
>>>
>>>Type :   Basic
>>>Time Frame :   Very Soon
>>>Assessment :  Pending
>>>
>>>The number of words before and after the colon can very so I can't use
> 
> the
> 
>>>RightWords function.
>>>
>>>Is there a way to copy everything on a line after a specific character?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 883-2846
FM Pro Solutions       Los Angeles, California
Associate Member, FileMaker Solutions Alliance
0
Reply Howard 2/29/2004 10:21:50 PM

<zaqq1111@yahoo.com> wrote in
news:v42dnbU-toAxqtzdRVn-hA@wideopenwest.com: 

> 
> I have a couple string fields that I want to copy into new fields but
> I want to exclude everything that comes before (and including) a colon
> : 
> 
> Type :   Basic
> Time Frame :   Very Soon
> Assessment :  Pending
> 
> The number of words before and after the colon can very so I can't use
> the RightWords function.
> 
> Is there a way to copy everything on a line after a specific
> character? 
> 
> Mike
> 
> 

middle(field, position(field, ":", 1, 1) +1, length(field))

Now, technically, that last "length" is going to run you over the end of 
the field, but it stops as soon as it hits the end, so it's not an issue.
0
Reply Robert 2/29/2004 10:31:54 PM

Darn.  I've done it again.  I posted without testing.  The calc should 
have been:

Middle(origtext,
    Position(origtext, searchfield, 1, 1) + Length(searchfield),
    Position(origtext & "�", "�", Position(origtext, searchfield, 1, 1), 
1) - (Position(origtext, searchfield, 1, 1) + Length(searchfield)))

Howard Schlossberg wrote:
> My understanding was that Mike wanted to grab one line's worth at a 
> time.  This would look like:
> 
> Where SearchField = "Type :" ...
> 
> middle(OrigText,
>    position(OrigText, SearchField, 1, 1) + length(SearchField) + 1),
>    position(OrigText, "�", position(OrigText, SearchField, 1, 1), 1) + 
> length(SearchField) + 1), 1) - (position(OrigText, SearchField, 1, 1) + 
> length(SearchField) + 1))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 883-2846
FM Pro Solutions       Los Angeles, California
Associate Member, FileMaker Solutions Alliance
0
Reply Howard 3/2/2004 2:14:38 AM

Am I to believe that Roberts example works in its entirety (being so
much shorter than the other examples), or is it just a segment.
Filemaker says there is a missing operator between the last length and
field.



tor (barely understanding this)


> 
> middle(field, position(field, ":", 1, 1) +1, length(field))
> 
> Now, technically, that last "length" is going to run you over the end of 
> the field, but it stops as soon as it hits the end, so it's not an issue.
0
Reply torlissa 3/2/2004 7:24:00 PM

I really hope that as people gather calculations from contributors to 
this site, they will look at those calculations and try to understand 
what they are doing.  And then I would hope they'd try it out to see if 
it actually does what they expect it to do.  be sure you copy and paste 
the entire calc, as I do not see any missing operators in Robert's post.

Robert's calc uses the middle() function.  It uses whatever is in the 
field called 'field', starting at the position of the character after 
the first colon, and going for the full length of the field (which for 
practical purposes in this example is to the end of the field).

So, it grabs the text from the colon to the end of the field.  Since I 
believe you want only the text to the end of a line, you should take a 
look at my calc and see if it does what you need.

torlissa wrote:
> Am I to believe that Roberts example works in its entirety (being so
> much shorter than the other examples), or is it just a segment.
> Filemaker says there is a missing operator between the last length and
> field.
> 
>>middle(field, position(field, ":", 1, 1) +1, length(field))
>>
>>Now, technically, that last "length" is going to run you over the end of 
>>the field, but it stops as soon as it hits the end, so it's not an issue.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 883-2846
FM Pro Solutions       Los Angeles, California
Associate Member, FileMaker Solutions Alliance
0
Reply Howard 3/2/2004 7:37:22 PM

7 Replies
333 Views

(page loaded in 0.477 seconds)

5/19/2013 6:35:39 AM


Reply: