Make sure you see the videos at http://code.google.com/p/freebase-gridworks/
Some tricks I want to remember for myself:
+ followed by the country code: e.g. +32
followed by the area code with the 0 between parentheses: e.g. (0)15
followed by the local code following this pattern X?XX XX XX: e.g. 23 45 67
Full example: +32 (0)15 23 45 67
The existing dataset contains slightly different phone numbers; shown as loaded into Gridworks.

Using regular expressions we can split the existing numbers in 2 groups using parentheses to indicate the groups:
(^\+\d{2}\s)(\d{1,2}\s\d+\s\d{2}\s\d{2}$)The regular expression as shown in the RX Toolkit of Komodo IDE.
![]()
Now using these groups to replace the existing values with a value conforming the wished structure using the replacement expression
group 1 followed by '(0) followed by group 2.
\1(0)\2
![]()
Now that we have our regex working, let's move on to Gridworks now.
On the column containing the telephone numbers, choose Edit cells, Transform ...
![]()
Now we can use the Gridworks expression language (GEL) to do our transform.
GEL offers a whole list of functions; we will be using 'replace'. 'Replace' takes 3 arguments:
replace(value,//,'')
where value refers to the value in the cell
where // delimits the regex
and '' contains the replacement string using the captured groups being indicated with '$', e.g. $1, $2.
In our case the expression became:
replace(value,/(^\+\d{2}\s)(\d{1,2}\s\d+\s\d{2}\s\d{2}$)/,'$1(0)$2')


forNonBlank(e, v, eNonBlank, eBlank)
In our case
forNonBlank(value, v, 'not relevant', 'museum')
Comments