Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

RegEx pull numbers from strings

Highlighted
7 - Meteor

Hi there, 

 

I'm trying to extract from this data below: 

 

GDP|GDP_N|real|MER|2021|03|Use|Koso|Y|38.233421|Market2010

 

Results in each column: 

GDP    GDP_N    2021   03   Koso   38.233421

 

 

How can I do this in Alteryx? 

 

 

Thanks!

Highlighted
Alteryx Certified Partner

Hi there

 

You don't need to use Regex. Text To Columns tools and a select should suffice. You can use the select to rename the columns as required as well.

 

See attached example

 

Cheers

 

G

Highlighted
7 - Meteor
Hi Gilly!

Thanks a lot for the help! It’s just that there are some other lines with more combinations (concatenates) included. I did text to column and some lines are divided into say 9 parts whereas some else into 11. That’s why I wanted to use Regex to just get the fields I’m after.

Could this be done in this case?
Highlighted
Alteryx Certified Partner

OK - I see what your problem is. However, I am assuming the values (GDP, GDP_N, etc) are going to change each input so we can't put a regex pattern to find "GDP","GDP_N" etc for example. Also, if the number of delimiters increases/decreases then we also can't use a search like first instance of "|" which is more like a TextToColumns tool.

 

If you are doing this manually, how do you know which fields you want to keep (ie the 6 out of the 10)?

 

Are you able to send some more data examples and I'll take a closer look

 

Cheers

 

G

Labels