yangyq10
(IvanY)
1
Dear Friends
I want to extract the number as below highlighted from a bunch of same format emails. However, the number length varies from emails to emails
May I know how to make it happen with [substring]?
PS: “円” must be excluded from the result

Thanks
Ivan
vrdabberu
(Varunraj Dabberu)
2
Hi @yangyq10
Assign -> Input = "現金価格合計(税込): 208,044円
申込金(頭金) :0円
残金 : 208,044円
分割払手数料 :0円
分割支払金合計 : 208,044円
お支払総額 : 208,044 円"
Assign -> Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=お支払総額\s+\:\s+).*(?=\s円)").Value.trim()
Regards
Yoichi
(Yoichi)
3
Hi,
Can you try the following expression?
System.Text.RegularExpressions.Regex.Match(yourString,"(?<=お支払総額\D+)[\d,]+").Value
regards,
yangyq10
(IvanY)
4
Dear Varunraj
Thanks for the prompt reply
May I know how to set ariable for the whole part from 現金価格合計(税込):208,044円 to お支払総額 :208,044円 so that I can use them in the regular expression?
The reason I ask this is that I have 10 to 20 same format emails which I need to extract the different [お支払総額] and wirte in excel.


yangyq10
(IvanY)
5
Dear Yoichi
Thanks for the prompt reply
May I know how to set variable for the email body?
I have 10 to 20 same format emails which I need to extract [お支払総額] from them and input into excel


vrdabberu
(Varunraj Dabberu)
6
Hi @yangyq10
Use Build Data Table Activity and create a column Amount like below
Do this after Get Outlook Mail Messages.
After extracting that you can use Add Data Row activity

Outside the For Each loop use Write Range Workbook to write dt_Output to an excel.
Regards
yangyq10
(IvanY)
7
Thanks for the reply
I try put mail.body.Tostring to replace the whole email text but nothing show up while debug
Do you know which part I may go wrong?
system
(system)
Closed
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.