今天主要分享从uipath中,怎样将txt文档的invoice号码提取出来。今天主要用到的功能是matches.同时涉及到了正则表达式的使用。
txt文件名:invoice_dummy.txt
✎测试Text
INVOICE
123 Basedow Street
Leipzig, DE, 04277 DATE 6/6/2016
Phone: 341 600 800 INVOICE # 850113
Fax: 341 600 801 CUSTOMER ID A700
Website: www.tiefland.com DUE DATE 7/21/2016
BILL TO
IDES AG Frankfurt
231 Lyoner Street
Frankfurt, DE, 60441
Phone: 69 700 777
INVOICE number 345677
UNIT PRICE QTY TAXED AMOUNT
5,000.00 1 X 5,000.00
[42] Subtotal 5,000.00
Taxable 5,000.00
Tax rate 10%
Tax due 500.00
Other -
INVOICE no 345467
TOTAL € 5,500.00
123 Basedow Street
Leipzig, DE, 04277
Bank Name: Ostbank Berlin
Bank Account: 7387324
IBAN Code: DE560000997387324
Tiefland Glass AG
下面就来学习怎样用uipath将txt文档各个Invoice number提取出来
设计的用到的基本功能:
read text file
matches
For each
write line
1 Read text file
新建variable,Output设置为:dummyTxt
2 选择Matches
Matches参数设置
Input: dummyTxt
Pattern: "Invoice\s((no|number|#)\s?\d)"
Misc Result: matchesInvoice
MatchesInvoice
Variable type选择-
system.Collections.Generic.IEnumerable
输入关键字match进行搜索,选择System.Text.RegularExpression.Match
3 For each
ForeachmatchinmatchesInvoice
write line textmatch.ToString
4 运行结果
main execution started
INVOICE # 850113
INVOICE no 345467
INVOICE number 345677
main execution ended
以上就是我的分享,如果大家有什么问题,欢迎在下面给我留言。
-END-
领取专属 10元无门槛券
私享最新 技术干货