Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Get all values after the occurrence of a first character

nithyas
7 - Meteor

Input : ABC, DEF, GHI, JKL

I would need the output as DEF, GHI, JKL. Basically extract all data after the occurrence of the first comma.

 

Thanks!

4 REPLIES 4
Dhairya
5 - Atom

Hi,

 

use text to column tool after the input, provide delimiter "," and break into rows, use record ID tool, use formula tool where record ID is not equal to 1, use cross tab and unselect the record ID column to get the original structure. 

AngelosPachis
16 - Nebula

Hi @nithyas ,

 

There are a couple of ways you can achieve this (maybe more). The most straightforward way is with a text to columns tool, using "," as a delimiter and splitting to 2 columns, leaving extra characters in the last column

 

AngelosPachis_0-1610266731834.png

 

Another way would be through RegEx, or a Regular Expression. What you say essentially with the expression below

 

, (.*)

 

is that you want to keep everything (whatever is in brackets) after the first comma and whitespace.

 

AngelosPachis_1-1610266850301.png

There may be more ways, it's up to you to decide which works for your case.

 

Let me know if you have any questions, hope that helps.

 

Regards,

 

Angelos

nithyas
7 - Meteor

Hi @AngelosPachis , thanks. Both of these work. But I guess I've run into another issue. We are also seeing data as below -

XYZ, INC.,ABC, DEF,LTD., - In this case, it would split column 2 into INC.,ABC - which is incorrect. Basically, the delimiter is also a comma and the escape character would also be a comma. Is there a way to use it in REGEX?

 

Thanks!

AngelosPachis
16 - Nebula

Hi @nithyas ,

 

So if your field is 

 

XYZ, INC.,ABC, DEF,LTD.

 

you want the RegEx to parse out

 

ABC, DEF,LTD.

 

Is that correct?

Labels