We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Trying to Parse the String using RegEX

Aparanjith_DSG
6 - Meteoroid

Hi,

I am trying to parse the below string, but looping into multiple issues, can anyone help me with the expression?

 

<File MaxRecords="" FileFormat="25">\\dcsg.com\shared\Acct\General Accting\Alteryx\I-2022-00746_Stockledger File Conversion\Output Files\Output - Stockledger File Conversion Check.xlsx|||Store and SL Dept Count</File>

 

 

From the above string I need to pull only the Path

 

\\dcsg.com\shared\Acct\General Accting\Alteryx\I-2022-00746_Stockledger File Conversion\Output Files\Output - Stockledger File Conversion Check.xlsx|||Store and SL Dept Count

 

Can anyone help me in this?

4 REPLIES 4
CoG
14 - Magnetar

REGEX_Replace([Field1], "^.*<File.*?>(.*?)</File>.*$", "$1")

 

This will work if you only have one file per record just substitute [Field1] for your field.

Aparanjith_DSG
6 - Meteoroid

Thanks for the reply Andrew, but this expression has divided into 2 different RegExOutputs and both of them are fetching only Null values. Please see the screenshot below.

CoG
14 - Magnetar

XD Whoops! Sorry, the expression I sent would go into the Formula Tool. If you want to use the Regex Tool, you need the following formula: ^.*<File.*?>(.*?)</File>.*$

Screenshot.png

 

Similarly, if you have multiple file paths per record, then you can use tokenize like so:

Screenshot 2.png

 

Aparanjith_DSG
6 - Meteoroid

Thanks so much Andrew, that worked.

Labels
Top Solution Authors