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.
Free Trial

Alteryx Designer Desktop Discussions

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

String Parsing

khanp27
6 - Meteoroid

I am trying to parse the following string to extract final destination path and name (highlighted in RED)

 

00:00:00.437 - ToolId 140: \\DRIVE\test\test.sql|67 records were read from "\\DRIVE\test\test.xls" ('DropDown$')

00:00:00.927 - ToolId 228: \\DRIVE\test1\test1.sql|69 records were read from "\\DRIVE\test1\test1.xls" ....

00:00:00.373 - ToolId 273: \\DRIVE\test2\test2.sql|67 records were read from "\\DRIVE\test2\test2.xls" ............................

Any leads will be highly appreciated. 

 

Thank you

5 REPLIES 5
Prometheus
12 - Quasar

@khanp27 I like to use www.regex101.com to help me parse out string. You can use this expression in the RegEx tool with the Parse function to get what you want: 

^.*\s\"(.*)\".*

String Parsing.PNG

flying008
15 - Aurora

Hi, @khanp27 

 

Parse method by RegEx tool :

Spoiler
(?<=from\s")(.+?)(?=")

录制_2023_09_23_08_39_50_332.gif

 

 

caltang
17 - Castor
17 - Castor

In addition to @flying008 @Prometheus ' work, you can also use:

(\\\\[^|]+)

image.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

Ah sorry my bad, you wanted the .xls and not .sql. Please use this instead:

(\\\\[^\|]+(?=\"))

image.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
binuacs
21 - Polaris

@khanp27 another method

image.png

REGEX_Replace([Input], '.*(\\\\.*\.xls).*', '$1')
Labels
Top Solution Authors