Jump to content

Extracting text fails at last line


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

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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