Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi,

I'm racking my brains ... I remember seeing somewhere how to extract SOME text from a field. In this instance I have a field entitled "Email From" which contains the usual email format of

{ "[email protected]" <[email protected]>}

and I want to remove the address that's within the <> marks. Trouble is .... I CAN'T REMEMBER. I'd appreciate any pointers

Thanks

Giles confused.gif

Posted

Hi Giles,

There are certainly more elegant ways (which I would LOVE to see) but this works (replace emailtext with your field name):

Middle ( emailtext; Position ( emailtext; "<"; 1; 1 ) + 1; Position ( emailtext; ">"; 1; 1 ) - Position ( emailtext; "<"; 1; 1) - 1 )

LaRetta wink.gif

Posted

Well, this feels better because it's easier to clearly see the logic and I think using Let() will decrease the number of Start evaluations from 2 to 1 although using Let() itself may offset the savings. Calc efficiency is important but I still struggle when comparing some calcs on which is more efficient:

Let(

[

Start = Position ( emailtext; "<"; 1; 1 ) + 1;

End = Position ( emailtext; ">"; 1; 1 )

]

; Middle ( emailtext; Start; End - Start )

)

Function Descriptions:

Position ( text ; searchString ; start ; occurrence )

Middle ( text ; start ; numberOfCharacters )

Let ( {[} var1 = expression1 {; var2 = expression2...]} ; calculation )

Posted

Hi Giles,

"my brain was starting to get somewhat twisted"

Oh, that's a wonderful sign; happy to hear it! It's only when one's brain sits and stagnates that it's a problem. Twisting, whirling, spinning, brain pain, blowing out and going insane are all good things for the mind - it gives it exercise and forces growth! cool.gif

LaRetta

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