May 18, 20196 yr Hi all Is there a calculation to remove all long text strings (say anything over 20 characters) from text fields? Thanks
May 18, 20196 yr Author The string(s) could appear anywhere within the field. I'm trying to clean up emails where there's lots of strings from hyperlinks that are in the signatures (usually from the email signature).
May 18, 20196 yr Then I am afraid I don't understand what you mean by "string". Wy don't you provide an example or two of what's in the field and what you would like to see as the result.
May 18, 20196 yr Author Emails are retrieved as records. And the body of the email might contain something like this: Click this link to unsubscribe from this email: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmypcsecurity.webrootanywhere.com%2Funsubscribe.aspx%3FT%3Dasdffsdf34228e3b-77d9-4eb2-8132-778fd4dea454%26UEM%3Dsupport%40madso.uk&data=02%7C01%[email protected]%7Casd29c4c0901c808d673d792d0%7C7a80fada51274aa9aaedca692e314d1d%7C1%xxx68237670672dddata=0YhXOxZRHF6%2Fls6fY%2BA4za%2BvsGo6dPBtWMQhVQZo%2ByE%3D&reserved=0 It's these long strings of text that I would like to remove as they make reading emails difficult (especially when there are multiple emails contacenated). But there are so many different ones that I can only think to do a search by length, rather than a specific substitute calculation. Edited May 18, 20196 yr by sal88
May 18, 20196 yr This is not going to be simple, because Filemaker can divide text only to paragraphs (values) and words. In your example, the substring: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmypcsecurity.webrootanywhere.com%2Funsubscribe.aspx%3FT%3Dasdffsdf34228e3b-77d9-4eb2-8132-778fd4dea454%26UEM%3Dsupport%40madso.uk&data=02%7C01%[email protected]%7Casd29c4c0901c808d673d792d0%7C7a80fada51274aa9aaedca692e314d1d%7C1%xxx68237670672dddata=0YhXOxZRHF6%2Fls6fY%2BA4za%2BvsGo6dPBtWMQhVQZo%2ByE%3D&reserved=0 is actually 32 separate words, the way Filemaker sees it. So you need to make up your own division - probably by looking for spaces and returns as the only separators to consider. And of course, this must be a recursive process, taking each "token" in turn and examining it for length. In the attached demo, I used a looping script (with 2 loops, one for paragraphs and one for tokens separated by spaces). To make this a calculation, you would need to replicate the same logic using a custom function (or functions). ShortenLongStrings.fmp12
May 19, 20196 yr 14 hours ago, sal88 said: Emails are retrieved as records. And the body of the email might contain something like this: Click this link to unsubscribe from this email: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmypcsecurity.webrootanywhere.com%2Funsubscribe.aspx%3FT%3Dasdffsdf34228e3b-77d9-4eb2-8132-778fd4dea454%26UEM%3Dsupport%40madso.uk&data=02%7C01%[email protected]%7Casd29c4c0901c808d673d792d0%7C7a80fada51274aa9aaedca692e314d1d%7C1%xxx68237670672dddata=0YhXOxZRHF6%2Fls6fY%2BA4za%2BvsGo6dPBtWMQhVQZo%2ByE%3D&reserved=0 It's these long strings of text that I would like to remove as they make reading emails difficult (especially when there are multiple emails contacenated). But there are so many different ones that I can only think to do a search by length, rather than a specific substitute calculation. Maybe display these emails in a webviewer so that the html code gets displayed properly? I did a google on removing urls form emails and got a lot of responses that had negative results from this. Apparently not as easy to do as it has a tendency to break a lot in the emails.
June 10, 20196 yr Author Thanks guys! I'll be exploring both options. I guess the new While function will be handy for comment's trimming option too.
Create an account or sign in to comment