Shivi
February 4, 2020, 10:58am
1
Hi All,
I need to extract data(integers) from email body. While I am trying to extract I am getting whole email body.
Below is the email body-
Details
etett-fqsdfg-4015-0000-sgrghq| 0000000000 | 000000| Data
etett-fqsdfg-4015-0000-sgrghq| 11111111111 | 111111 | Data
Details
Details
etett-fqsdfg-4015-0000-sgrghq| 2222222222 | 5555555 | Data
etett-fqsdfg-4015-0000-sgrghq| 3333333333 | 6666666 | Data
Details
strong text
Please let me know if you have solution for this.
Thanks
Hi @Shivi
can you show me an example in which format you want ?
thats the sample can you show us the sample output also??
cheers @Shivi
SowmyaLeo
(Sowmya Sivakumar)
February 4, 2020, 11:21am
4
@Shivi
After extracting the email body as a text file you can apply a regex with pattern \d+ to extract only the digits.
The regex matches activity can be used.
Shivi
February 4, 2020, 11:44am
5
I just need to get that value(highlighted in blue color) as it is, I need to copy that value in excel file.
well
use matches activity to extract number and pass this pattern \s\d+\s{0,1}
to get the numbers
and use Add Data Row to add those string value
and give DataTable variable and use that in write Range!
cheers @Shivi
tried you string here you can see the results here regex101: build, test, and debug regex
cheers @Shivi
gulab
(Gulab Kazi)
February 4, 2020, 11:49am
8
Hi @Shivi
Split the email body by newline and loop and check if it contains (“etett”) or (“Data”)
then split by | or using sub string extract the required value.
it’s taking the | character also @mitesh_parmar
cheers
SowmyaLeo
(Sowmya Sivakumar)
February 4, 2020, 11:59am
11
@Shivi
If the text in blue is only needed you can:
Use an array and split the text by Environment.NewLine.
You will get an array of strings.
Use a for each loop and within that you can split each line of text by “|” and get the second and third value from the array.
system
(system)
Closed
February 7, 2020, 1:08pm
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.