Hi, I have one table with phone numbers and another with regex for possibles mobile/phone numbers. I'd like to extract which ones of the first ones are mobile and which ones are regular phones. is it possible with feature merger? Many thanks
Is it possible to add an example? It will be better if you can share a sample of the data which you are working on.
You can use the string searcher, attribute creator, tester etc. to do that.
As you need to execute the regex on the attribute holding the numbers, so you cant use the feature merger for that.
Your requirement would use 2 string searchers.
Or one tester or one attributecreator with conditional attribute creation.
Hi, as example I have a list of numbers such as 609412859, 650451278, 917173737, 925425693, and the another list with regex like
^[8-9]{1}[0-9]{1,2}[0-9]{6,7}$ for phone
^[6-7]{1}[0-9]{2}[0-9]{6}$ for mobile
so I can define which ones of the first list are phone and which ones mobile
the list is huge, this is just an example.
many thanks
Hi, as example I have a list of numbers such as 609412859, 650451278, 917173737, 925425693, and the another list with regex like
^[8-9]{1}[0-9]{1,2}[0-9]{6,7}$ for phone
^[6-7]{1}[0-9]{2}[0-9]{6}$ for mobile
so I can define which ones of the first list are phone and which ones mobile
the list is huge, this is just an example.
many thanks
If you have only a few patterns (regular expressions) and they are static (i.e. won't be changed for each run), I think that configuring a conditional value for all possible regular expressions would be an easier solution, than reading regular expressions from the second table at run-time. The conditional value setting looks like:
If @Value(number) Contains Regex ^[8-9]{1}[0-9]{1,2}[0-9]{6,7}$
Then phone
Else if @Value(number) Contains Regex ^[6-7]{1}[0-9]{2}[0-9]{6}$
Then mobile
Else unknown
If you need to get regular expressions and corresponding phone type names from the second table anyway, a possible way is: unconditionally merge all the regular expressions and phone type names to every phone number feature as a list attribute with a FeatureMerger, explode the list with a ListExploder, then use a Tester to test every feature whether its phone number matches the regular expression. In terms of the performance, however, it might be better write a Python script.
try this one
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.