Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Text parsing assistance needed

Featured Replies

I am using the MailIt plugin to pull in emails from an IMAP folder. I have the email in FM13, but I want to remove the thread (keeping only the actual response). Example:

---------

Sounds great! See you then!

 
On Apr 1, 2015, at 12:33 PM, User <[email protected]> wrote:
 
___ ITS Service Ticket 0316 ___
Can we meet at 10AM today?
---------
 
I would like everything before the "On Apr 1"....
Here is what I have now (which removes the thread but not the "On Apr 1...":
 
Left ( MailIt_Messages::Body; Position( MailIt_Messages::Body; "___"; 1; 1 ) -3 )
 
Any ideas?
 
Thank you,
 
Brian

Let (

[

_first = Position( MailIt_Messages::Body; "___"; 1; 1 ) ;

_second = Position( MailIt_Messages::Body; "On"; 1; 1 )

];

 

 

Middle ( MailIt_Messages::Body; _first ; _second - _first )

 

)

Will return

Sounds great! See you then!

 

 

including the trailing CRLF and only works if "On" or "on" (Position() is NOT case sensitive) is never in the message body

I would like everything before the "On Apr 1"....

 

That's a very problematic way to state your requirement, because the message itself could easily contain the string "On Apr 1". Not to mention that the actual month and day are likely to change, and counting on "On " as being the cut-off point is practically guaranteed to fail with many messages - consider for example:

Sounds great! See you on Monday! Don't forget to bring the stuff.

On May 5, 2014 ...

which would be shortened to:

Sounds great! See you 

You should look for a more reliable "marker" to signify where the message ends. We only have a single example to look at, but perhaps you could consider the first carriage return preceding the string "> wrote:¶". Assuming this string consistently appears in the line following the message (and its being unlikely to appear in the message itself), you could use:

Let ( [
mark = Position ( text ; "> wrote:¶" ; 1 ; 1 ) ;
end = Position ( text ; ¶ ; mark ; -1 )
] ;
Left ( text ; end -1 )
)
  • Author

Thank you both. Ended up using Comments version and added in a case statement to adjust for different email clients. Sorry for the delayed response (got working on other aspects of the solution)! Brian

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.