简体   繁体   中英

Spotfire extract decimal numbers from string column

I have a string column that looks like this:

ColumnA
"POINT (10.203942930 45.2903203)"
"POINT (11.356898730 25.2548565)"

from which I would like to extract the numbers and create two separete columns:

column1
10.203942930
11.356898730

column2
45.2903203
25.2548565

I have tried RXReplace, but I get one single number which is not decimal...

RXReplace([col], "[^0-9]", "", "g")

Any help will be really appreciate it.

Thanks in advance.

@thundermils - Please try this solution.

Step 1: Create a calculated column which separates text 'POINT' from "POINT (10.203942930 45.2903203)"

left(right([Column A],Len([Column A]) - Find("(",[Column A])),-1)

Now, separate the two numbers into two separate columns.

Step 2: Create 'calc1' column with the below custom expression

Trim(left([calc],Find(" ",[calc])))

Step 3: Create 'calc2' column with the below custom expression

Trim(right([calc],Len([calc]) - Find(" ",[calc])))

Here is the final output:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM