Alteryx Designer Desktop Discussions

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

RegEx Parsing Columns with Null or String

nuclearpz86
Meteoroide

Hi 

I'm new to RegEx, and I'm hoping to get some help parsing column that maybe Null or a String (word). As well as parsing for decimals, and negative numbers. 

 

Original

ID,Completion_Status,new_cx_flag,
-2, ,1.0000
-2, ,.0000
146920,Yes,1.0000
133734,No,.0000

 

Desired Outcome

IDCompletion_Statusnew_cx_flag
-2 1.0000
-2 0.0000
146920Yes1.0000
133734No0.0000

 

Thanks in advance

5 RESPUESTAS 5
fmvizcaino
17 - Castor
17 - Castor

Hi @nuclearpz86 ,

 

Attached is a example showing how to get that done with text to column tools and regex tool.

 

Let me know if that works for you.

Best,

Fernando Vizcaino

nuclearpz86
Meteoroide

Would the solution be different if for the second column is NULL instead of of a space

ID,Completion_Status,new_cx_flag,
-2,,1.0000
-2,,.0000
146920,Yes,1.0000
133734,No,.0000

 

echuong1
Alteryx Alumni (Retired)

You can also achieve this using the text to columns tool and the dynamic rename. 

 

Essentially, you'd import the file without field names and then use th

echuong1_0-1576707855528.png

e text to columns to parse by comma. From there you can change the field names using dynamic rename. 

 

 

fmvizcaino
17 - Castor
17 - Castor

With text to columns tool, its the same.

For the regex formula, it would need a small change for ([^,]*),([^,]*),([^,]*)

 

Best,

Fernando Vizcaino

nuclearpz86
Meteoroide

Thank you so much @fmvizcaino  and @echuong1 for all your help!

Etiquetas