Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

convert data in one field to new field names

chvizda
8 - 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

 

 

 

4 REPLIES 4
CharlieS
17 - Castor
17 - Castor

@chvizda

 

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.

danrh
13 - Pulsar

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

image.png

chvizda
8 - Asteroid

Hi Charlie S

Thanks for your solution. It works perfect !!

 

Steffen

chvizda
8 - 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
Top Solution Authors