-1

I am using OpenRefine and have values like:

33.469.444  or 3.333.444

which I want to convert to:

33469.444 or 3333.444

So I want to remove the first dot (".") in every word.

Anyone has a clue?

Nikhil VJ
  • 5,630
  • 7
  • 34
  • 55

2 Answers2

2

If you use Jython instead of GREL... you can take advantage of a cool function called

replace(new,old,[max occurances]) like so:

return value.replace(".","",1)

If you need to remove the first 4 period characters then:

return value.replace(".","",4)
Thad Guidry
  • 579
  • 4
  • 8
0

You should use the split() function to select the first. You can do something like this: value.split(".")[0] + value.split(".")[1] + "." + value.split(".")[2]

This will split the value on into an array based on the .

  • value.split(".")[0] select the first element in the array
  • + value.split(".")[1]select the second element and add it to the first (and remove the dot)
  • + "." + add the dot needed in the rest of the string
  • value.split(".")[2] select the third element in the array
magdmartin
  • 1,712
  • 3
  • 20
  • 43