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');