Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

RegEx or Text-to-Column Dynamic Parse

mmvcans
7 - Meteor

Hi all,

 

I have record strings, separated by spaces, but with differing numbers of decimal data points. For example:

 

Row 1: 0 3.546 0 5.678

Row 2: 7.34 0 5.91

 

Is there a way to create a dynamic RegEx statement (or TtoC statement) which would return a data point individually within a column? Ideally, if row 1 contained more data points than row 2, the empty row 2 columns would be returned as null values. The output would look like:

 

 RegExOut1RegExOut2RegExOut3RegExOut4
Row 103.54605.678
Row 27.3405.91[Null]

 

I'm struggling to write a simplified expression without creating significant redundancies in the RegEx statement, ie 

(\d+\.?\d*)\s(\d+\.?\d*)\s(\d+\.?\d*)\s.....

 

Thanks!

 

Mike

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @mmvcans 

 

Here's one way to do this dynamically.

 

Thableaus_0-1591900926000.png

 

 

- Add a Record ID

- Use Text to columns with the delimiter as \s (space) and splitting to rows

- Use a Tile Tool on Unique Value as Record ID

- Use the Cross-Tab Tool to put this back into columns, using Tile_SequenceNum as the column names.

 

Cheers,

mmvcans
7 - Meteor

@Thableaus - worked like a charm; thanks for the quick response!

Labels