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

Alteryx Designer Desktop Discussions

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

Parsing Help

Marp
7 - Meteor

Hi All

Hope you are all doing fine!

 

Tried to parse below data before posting question here

 

I need to parse PLR data from below string - each PLR is separated by coma (;)

 

Data:

122132;PLR-111-2323-91;323233;UKCRN-18799;PLR-454-2656-1;34-159980;NCI-2015-00115;ad773432;rere20130320

 

Result :

PLR-111-2323-91 ; PLR-454-2656-1

 

PLR values could be one or More

 

 

Thanks Again for your help

 

 

8 REPLIES 8
Marp
7 - Meteor

Hi All

 

I could able to parse with the code below

 

.*?PLR(.*?)\;

 

not working with the string more than one occurrence

 

Please Advise

KarolinaRoza
11 - Bolide

Hi @Marp 

 

You can try different way then regex.

Text to rows -> Filter contains "PLR" -> Summarize with concatenate

 

For me it is easier way to do it 🙂

 

Regards,

Karolina

 

KarolinaRoza_0-1620421463012.png

 

vizAlter
12 - Quasar

Hi @Marp — Try this solution if you want to use a RegEx tool:

 

 

 

 

 

(PLR[-0-9]+)

or

(PLR-[0-9]+-[0-9]+-[0-9]+)

or use below if a ";" sign always comes in the end:

(PLR-[0-9]+-[0-9]+-[0-9]+\;)

 

 

 

 

vizAlter_0-1620425952860.png

 

 

 

 

And, you may use a Summarize tool if you want to put the results like below:

vizAlter_0-1620426767666.png

 

 

 

Please mark this post solved if it helps.

KarolinaRoza
11 - Bolide

Hi again,

 

I realized that my previous solution may not work in case you have more rows.. 😕

 

Please try below, I also do not use regex and this has several steps but should work.

 

Let me know if it is fine,

Karolina

KarolinaRoza_0-1620425702282.png

 

 

Marp
7 - Meteor

Hi Viz Alter

 

Thank you for your time helping on this issue

 

My results are truncated some of the numbers at the end

 

my String:

20130320;PLR-2014-001700-21;UKCRN-18799;CANC-4404;IRAS-159980;PLR-2014-02300-241;R773432;MT20130320

 

 

i am getting results below

PLR-2014-001700-2 instead of full value ( PLR-2014-001700-21)

PLR-2014-02300-241

 

Marp_0-1620489888370.png

 

KarolinaRoza
11 - Bolide

Hi,

 

in your formula you are missing '+' at the end.

It should be: 

PLR-[0-9]+-[0-9]+-[0-9]+

If you have only [0-9] it returns you just one number, instead of several numbers, you can apply either '+' or '*' instead.

 

Karolina

Marp
7 - Meteor

Hi KarolinaRoza

 

Thanks you very much 

it worked!

 

vizAlter
12 - Quasar

@Marp and @KarolinaRoza — Thank you! 🙂

Labels