Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Parsing question

jeffv
8 - Asteroid

All,

 

A quick question hopefully....  I have data such as the following:  yyyy-mm-dd hh:mm:ss - <some message>yy-mm-dd hh:mm:ss - <some message> (and this can be several timestamps long)

 

What I need to do is to split the first three dates and messages into fields and drop remaining data from field.

 

Using Text to Columns tool the separator is a date so can't use that.  Using regex I'm not sure how I tokenize the data into fields.  Maybe there's a different tool to be used.  Any help appreciated.

 

Thanks,

Jeff

3 REPLIES 3
apathetichell
20 - Arcturus

regex tokenize. If it's exactly 3 and always 3 you can keep them as columns, otherwise add a recordid beforehand and split to rows...

 

your formula should be something like:

 

(\d{4}-\d{2}-\d{2}\s\d{2}\:\d{2}\:\d{2})

 

For your tokenizing. If that doesn't work then post some sample data and I can fix it... After converting you can add a date/time tool or formula and use the todate or datetimeparse functions (and if you've split to rows it's only one column to match for date/time)

jeffv
8 - Asteroid

Thanks for response....  it won't always be three sometimes 1, sometimes multiple, but I only need to keep the first three entries.

 

Probably need some clarification though...  using the formula you suggest with tokenize I only see dates in the three fields it creates.  What I'd like to see id the date and the message.  Putting ".*" at the end doesn't quite get it either as then it gets everything. (\d{4}-\d{2}-\d{2}\s\d{2}\:\d{2}\:\d{2}.*)

 

Thoughts?

 

Thanks,

Jeff

apathetichell
20 - Arcturus

Sorry - saw that part later - try this with another regex tokenize/split to rows on the original data- -\<(.*)\> then you can union in via position your two tables.

 

If that's not working can you post a data sample?

 

 

Labels
Top Solution Authors