Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hello All

I have a text field called "bigtextfield" which contains many lines of "tagged text" items of which the following are just three:

<>Charlie Anylength

<>[email protected]

<>sometext

I have a calculation field of the following format, which successfully does what I want, which is to "parse" the contents of the above field splitting the text of each <> into a separate field:

Let ( [

start = Position ( bigtextfield ; "<>" ; 1 ; 1 ) + Length ( "<>" ) ;

end = Position ( bigtextfield ; "¶" ; start ; 1 )

] ;

Middle ( bigtextfield ; start ; end - start )

)

However, it fails for the final line of "bigtextfield" because that one doesn't end with a return ("¶")!!

Can someone give me a version which works even for a line which is followed by nothing!

Many Thanks.

Posted

Try:


Let ( [

start = Position ( bigtextfield ; "<>" ; 1 ; 1 ) + Length ( "<>" ) ;

end = Position ( bigtextfield & ¶ ; ¶ ; start ; 1 )

] ;

Middle ( bigtextfield ; start ; end - start )

)

Posted

Thank you, comment. That seems to work nicely!

The only time it doesn't work is if I have a typo in the name of the <> being extracted, in which case instead of being left blank, it seems to pick up the value of another <>!!

Can you suggest a way to catch this?

Thanks again.

Posted

Let ( [

pos = Position ( bigtextfield ; "<>" ; 1 ; 1 ) ;

start = pos + Length ( "<>" ) ;

end = Position ( bigtextfield & ¶ ; ¶ ; start ; 1 )

] ;

Case ( pos ; Middle ( bigtextfield ; start ; end - start ) )

)

Posted

Thanks, once again!

It seemed to need one more ) at the end, but once that was put in it seems like it works perfectly.

Your help is much appreciated. PHILIP

Posted

You're right...

The final ")" was of course in your code, but I failed to include it when copying-and-pasting it.

My apologies!

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