April 10, 200520 yr 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
April 10, 200520 yr 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
April 10, 200520 yr 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 )
April 11, 200520 yr Author THAT IS SO COOL ... thanks for that, my brain was starting to get somewhat twisted Giles
April 11, 200520 yr 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
Create an account or sign in to comment