community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

I need to parse my field

Asteroid

Hello everyone,

 

I need to parse my field and pasted the data below. Can you please help on this? 

 

Field:

Status: New Manager: Sweety Type: General First Name: Jon 

 

Expecting Results like below:

 

StatusManagerTypeFirst Name
NewSweetyGeneralJon
Comet

As a first step, you could use a formula like

 

REGEX_Replace([field_with_that_line], "([^\s:]*:)", ",$1")

 

to insert a comma before each column header. The regex [^\s:]*: says "match a string consisting of any number of characters with no spaces or colons followed by a single colon"

 

This will produce output like 

,Status: New ,Manager: Sweety ,Type: General First ,Name: Jon

 

which you could split into columns using a TextToColumns tool. The rest of the reformatting could probably be done using TextToColumns and a transpose/crosstab combination. Let me know if you have questions about that, or if I've misunderstood what you're data looks like.

Asteroid

It would be great if you can share sample workflow.Thanks!

Asteroid

Can you please send me sample workflow so that i can see how to perform it. Thanks!

Comet

Actually, if you know what the column headers are ahead of time, it might be easier to just use some FindString formulas to figure out where the column headers start and end and extract the content from between them, like this (see attached workflow)MakeTabular.PNG

Labels