SET ISBN_RegEx = 'ISBN[ ]*([0-9]{3})-([0-9]{1})-([0-9]{4})-([0-9]{4})-([0-9]{1})';
ISBN:
LOAD IndexRegEx(EmailText,'$(ISBN_RegEx)',1) AS ISBNCode1,
IndexRegEx(EmailText,'$(ISBN_RegEx)',2) AS ISBNCode2,
IndexRegEx(EmailText,'$(ISBN_RegEx)',3) AS ISBNCode3,
* INLINE `
EmailText
Hi there! I have some books that I'm interested in ordering from your distribution center. Just wanted to make sure they were in stock before I put the order in on the system - do you think you could tell me whether you have these in stock, and how many you might be able to ship us? Thanks! Item 1: ISBN 123-3-1234-1234-0. This is one I've had a really hard time getting a hold of lately. Do you think you would have 5 in stock? If not, can I put a hold on the next 5 you get? Item 2: ISBN 012-2-0123-0123-4 ... This one is not high-priority, but if you have one, I'll take it! Item 3: ISBN 000-1-0123-0123-2. Customers have been requesting this one for a long time, and we haven't had it in stock for years due to it being out of print. Any chance you might have 7 of them? Thanks!
` (delimiter is '/t/';
结果
加载数据并打开工作表。创建新表并将这些字段添加为维度:
ISBNCode1
ISBNCode2
ISBNCode3
结果表
ISBNCode1
ISBNCode2
ISBNCode3
301
487
588
例 2 - 用图表表达式识别有辅助电话号码的联系人
概述
打开数据加载编辑器,并将下面的加载脚本添加到新选项卡。
加载脚本包含:
一个名为 BusinessContactInfo 的表格,其中包含在各公司网站上找到的公司信息。
ContactInfo 是一个包含公司电话号码的字段。我们想确定哪些公司有多个电话号码。
我们的要求:
电话号码必须是 10 位数的 NANP 电话号码。
我们希望允许用括号将地区代码括起来。
我们希望在每个电话号码段之间留出一个空格或连字符。
加载脚本
BusinessContactInfo:
Load * Inline `
ID CompanyName ContactInfo
1 Company A (123) 456-7890 (023) 123-4567
2 Company B 0123456790 1357913579 0246802468
3 Company C 234-567-8901
` (delimiter is '\t');