Email body split activity

hi i have a mail body like this

hello

keyskills:java

min: 2

max: 4

location: noida

thanks and re

here it just a sample, here keyskill may be change like java,.net,sql etc

now i want to extract keyskill,min,max,noida into four variable.please help

Hi @Sandeep_Kumar2,

You can achieve using regex to store the value into 4 different variable.

Hi @Sandeep_Kumar2,

Use assign activity
strMailContent= strMailContent.replace(Environment.NewLine," ")

keyskills Value:
Use Matches activity
Properties
Input : strMailContent
Pattern : ((?<=keyskills:).*(?=min:))
Result: iEnumResult -> IEnumberable<Match>
after that use assign activity to get the data
strSkill =iEnumResult (0).ToString()

1 Like

@Sandeep_Kumar2 Can you please tell format will be same or different or can you please give some more examples

In mail body it is like this

hello,

keyskills:java,.net.sql
min:2
max:4
location:noida

thanks
sandeep kumar

but in uipath it comes into format like this

Hello,keyskills:java,min:2,max:3,location:noidathanks sandeep kumar

help me
can you send xaml related to this

Hi @Sandeep_Kumar2,

Use assign activity
strMailContent= strMailContent.replace(Environment.NewLine," ")

keyskills Value:
Use Matches activity
Properties
Input : strMailContent
Pattern : ((?<=keyskills:).*(?=min:))
Result: iEnumResult -> IEnumberable<Match>
after that use assign activity to get the data
strSkill =iEnumResult (0).ToString()

Min Value:
Use Matches activity
Properties
Input : strMailContent
Pattern : ((?<=min:).*(?=max:))
Result: iEnumResult -> IEnumberable<Match>
after that use assign activity to get the data
strMin =iEnumResult (0).ToString()

Max Value:
Use Matches activity
Properties
Input : strMailContent
Pattern : ((?<=max:).*(?=location:))
Result: iEnumResult -> IEnumberable<Match>
after that use assign activity to get the data
strMax =iEnumResult (0).ToString()

location Value:
Use Matches activity
Properties
Input : strMailContent
Pattern : ((?<=location:).*(?=thanks))
Result: iEnumResult -> IEnumberable<Match>
after that use assign activity to get the data
strlocation =iEnumResult (0).ToString()

@Sandeep_Kumar2 Check attached file meets your requriement

Main.xaml (9.7 KB)