Remove dynamic text from outlook email

Good day everyone, please help here:
So my bot is reading outlook email body, emails which are different but I need to remove some parts of the text on the email…
I want to remove that part on the email,


and only the actually email is left from ‘Good day’.

When the email body is printed it it’s like this on the text file:
image


Here is an example of another email body, which has a different email address otherwise everything else seems to be the same every time like thee text from :

‘You dont often get email from . Learn why this is important
Please be cautious
This email was sent from outside of . Don’t click on any suspicious links or open attachments!’

I don’t want all of that I only want the exact email under all that. How can I achieve that, please help.

There’s just simple way of doing is using replace with regex
just use assign after your read text file activity,

note (String) = System.Text.RegularExpressions.Regex.Replace(InputText,"^(.*\n){2}","")

here,
InputText —> is output variable of read text file activity
And Regex pattern (“^(.*\n){2}”) simply get first 2 rows from the string variable and replaced it with null, now you can use write text file activity and pass that note var in it, that’s it.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.