In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Parse Text

bertal34
9 - Comet

Hello,

 

Is there a clean way to parse the attached Text?  I am trying to arrive at the Metric/Value fields but having trouble with a parsing solution capable of working for all scenarios.

 

 

thanks!

3 REPLIES 3
AGilbert
11 - Bolide

That is a tricky set of strings. As a first step you could replace the first occurrence of more than one space with a ':' as a common character to split the key/value pairs. Just an idea that might help piecemeal the problem. 

 

multi_space_replace.png

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @bertal34 ,

 

I would use Column To Text after replacing the parsing patterns with a separator.

I hope this helps.

 

Input

Text
Case 1: Separated with colon + space
Case 2   Separated with more than two spaces
Case 3  Separated with more than two spaces  and multiple  fields

 

Output

Text12
Case 1: Separated with colon + spaceCase 1Separated with colon + space
Case 2   Separated with more than two spacesCase 2Separated with more than two spaces
Case 3  Separated with more than two spaces  and multiple  fieldsCase 3Separated with more than two spaces

 

Workflow

1281054_Workflow.png

 

Text To Column Configuration

1281054_Config.png

bertal34
9 - Comet

@Yoshiro_Fujimori perfect solution, thank you!

Labels
Top Solution Authors