Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Keep everything after the first number in a string

Link86
8 - Asteroid

Hello, I am building a workflow that will be able to compare files in two different directories. To ensure that I am comparing the same file from each directory, I want to join on file path. The file paths will be the same after the first number in the string. I would like to keep only the digits after the first number. Below is an example of a file path and what I would like to keep. I have tried regex, but I am afraid that it has not been working out as well as I am not super familiar with regex expressions. I also tried findstring in a formula but it does not work since the numbers will not always be the same. They are essentially a date from when the file was pulled. Thank you in advance for your help.

 

Example:

Testing_20210730\HP-Testing\resource\Plan Type\Testing\RULES\FTE_BY3.xml

 

Keep:

20210730\HP-Testing\resource\Plan Type\Testing\Testing\RULES\FTE_BY3.xml

or

0210730\HP-Testing\resource\Plan Type\Testing\Testing\RULES\FTE_BY3.xml

or

\HP-Testing\resource\Plan Type\Testing\Testing\RULES\FTE_BY3.xml

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @Link86 

 

Here is how you can do both of them

 

Workflow:

atcodedog05_0-1635769093728.png

 

Hope this helps : )

 

Link86
8 - Asteroid

This is perfect thank you. Only one follow up question, what does the $1 actually mean? I tried removing it to see what it did and it just cleared the string all together.

atcodedog05
22 - Nova
22 - Nova

Hi @Link86 

 

It means content in the first set of round brackets. Its part of parse mode.

 

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Tool-Mastery-RegEx/ta-p/37689 

 

Hope this helps : )

Link86
8 - Asteroid

Awesome, thank you. Also, thank you for the link.

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Link86 

Cheers and have a nice day!

Labels