I just want to get the part in bold and created a Regex to select this part. My idea is to replace the complete string and just keep the string part with the coordinates (bold part).
My Regex: rijksdriehoekX":[0-9]{6}.[0-9]{3},"rijksdriehoekY":[0-9]{6}.[0-9]{3}
Any ideas how to solve this issue?
Best answer by hkingsbury
lambertus wrote:
Thanks @hkingsbury ! The regex works perfect. I have filtered now all records which contain coordinate values.
However, I still need to subtract these coordinates from the string per record and turn them into attribute values in such a way they can be used in a VertexCreator. Do you have any suggestions? 😃
My goal, using the example above, get finally 2 columns with x and y coordinates.
A small change to the regex can achieve that, adding two extra capture groups around the coords
adding a capture group around the whole statement "(...)"
switch [0-9] to \d
escaped '.'. In regex a '.' means any character. by escaping it with a '\' you will only match a '.'
to extract that match, use a StringSearcher. It there is a match it will come out on the '_first_match' attribute
One thing I did note, are your coordinates always going to be 6 long followed by 3dp? you may want to look at adding a range, especaily for the decimal places. {1,3} will match 1 to 3 numbers long
adding a capture group around the whole statement "(...)"
switch [0-9] to \d
escaped '.'. In regex a '.' means any character. by escaping it with a '\' you will only match a '.'
to extract that match, use a StringSearcher. It there is a match it will come out on the '_first_match' attribute
One thing I did note, are your coordinates always going to be 6 long followed by 3dp? you may want to look at adding a range, especaily for the decimal places. {1,3} will match 1 to 3 numbers long
Thanks @hkingsbury ! The regex works perfect. I have filtered now all records which contain coordinate values.
However, I still need to subtract these coordinates from the string per record and turn them into attribute values in such a way they can be used in a VertexCreator. Do you have any suggestions? 😃
My goal, using the example above, get finally 2 columns with x and y coordinates.
Thanks @hkingsbury ! The regex works perfect. I have filtered now all records which contain coordinate values.
However, I still need to subtract these coordinates from the string per record and turn them into attribute values in such a way they can be used in a VertexCreator. Do you have any suggestions? 😃
My goal, using the example above, get finally 2 columns with x and y coordinates.
A small change to the regex can achieve that, adding two extra capture groups around the coords
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.