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

Alteryx designer Discussions

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

convert data in one field to new field names

Asteroid

Hi all

 

I get my data from an e-mail. The data are in the email body. I can read the data by using the "text to column" tool. The output you see in the attachment.

 

In the field "Text Body 19" are the names of the values which are in "Text Body 20".

 

Unfortunately the structure of thedata in "Text Body 19"  and "Text Body 20" are not the same in every new dateset I get. 

 

In this example, the 1st row has no data for "Blocked: e-mail FIrewall"

 

How can I match the name in the first field to the data in the 2nd field and add the right data to the field with the right name in the output?

 

Many thanks for your help

 

Steffen

 

 

 

Alteryx Certified Partner
Alteryx Certified Partner

@vizda

 

The trick I used here was to use rows instead of columns to match all the Name::Value pairs. First I identified the fields by replacing any sequence of two or more space characters with a new delimiter with the following RegEx

 

formula: REGEX_Replace([TextBody19],"\s{2,}","|")

 

After the values were identified, it was just left to transform it back into a usable format. My solution is attached. Let me know if you have any questions.

Pulsar

Same basic concept as @CharlieS, just another approach for how to go about parsing:

image.png

Highlighted
Asteroid

Hi Charlie S

Thanks for your solution. It works perfect !!

 

Steffen

Asteroid

Hi @danrh

 

your solution looks pretty clean and straight forward.

Unfortunately the "Total" field is missing in the output. I assume it is only a small change in the Regex (but not for me as an Regex newbie).

 

Kind regards

Steffen

Labels