Help in extracting email

I am trying to extract email from an email body.

The sample mail body is as below.

Email: abc@gmail.com
Status: Price Too High
Message: Test Message

I want to copy each as a separate Colum in excel.

expected output in excel

Email Status Message
abc@gmail.com Price Too High Test Message

Thanks

@Sudish_Babu

You can write Regex for extracting the Email, Status, Message as below

image

Create a variable for Mail body like MailBody = Item.Body.ToString

Create a variable as EmailAddress and Write Regex as below for Email

EmailAddress = system.text.regularexpressions.regex.Matches(MailBody, “(?<=Email:).+”)

This will extract the email address likewise write for remaining

And use Add datarow activity to write back to the datatable

Hope this will help you

Thanks

Cannot assign from type ‘System.Text.RegularExpressions.MatchCollection’ to type ‘System.String’ in Assign activity ‘Assign’.

I am getting an error like this

@Sudish_Babu

Can you share the screenshot of your workflow?

Thanks

the error is gone.

the actual mail body is also attached
mail body.txt (1.4 KB)

Help is appreciated.

grafik

ensure following:
RegexImport

Also have a look here:

Also working with your txt file content:
grafik

@Sudish_Babu

Great!!

Please mark as solution and close this thread if this helps, so that others can benefit from this

Happy Automation

Thanks