Hi everyone,
Currently I am using the Regex tool to parse data to their specific columns. However, the parsed data are not accurate where the - v e symbol of a value was separated to other column. Is there any improvement that can be made on my expression below?
This are the expression that I used:
(.*?)\s(.*?)(\d+\.\d+|n\/a?).*?(\d+\.\d+|n\/a).*?(\d+\.\d+|n\/a)\s(.*?)\s(.*?)(\d+\.\d+|n\/a?).*?(\d+\.\d+|n\/a).*?(\d+\.\d+|n\/a)
This are the input:
1 Finland 1.38 100.00 1.00 74 Malawi –0.07 64.39 0.48
47 South Africa (2007) 36.76 40.01 0.56 n/a Iceland n/a n/a n/a
n/a United Kingdom n/a n/a n/a n/a Kyrgyzstan n/a n/a n/a–1.05 40.44 0.15
Solved! Go to Solution.
Hi,
Based on your problem, here is my opinion.
If the field you're capturing has the potential to have a negative sign in front of it, then one solution is to put a [^\w]? at the beginning of the expression capturing numeric values. In this case, the updated RegEx will look like.
I attached the regular expression and the workflow as well.
Hope this helps. Cheers