giles Posted April 10, 2005 Posted April 10, 2005 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
LaRetta Posted April 10, 2005 Posted April 10, 2005 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
LaRetta Posted April 10, 2005 Posted April 10, 2005 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 )
giles Posted April 11, 2005 Author Posted April 11, 2005 THAT IS SO COOL ... thanks for that, my brain was starting to get somewhat twisted Giles
LaRetta Posted April 11, 2005 Posted April 11, 2005 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! LaRetta
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now