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

Extracting the Name in the Full Path

KamenRider
11 - Bolide

Hi,

 

I have the full path output as field name. For example [path name... |||'Marimar$'. I would like to get only the name Marimar or Jeger which is found at the end of the path which corresponds to sheet name.

 

Please let me lend any of your assistance.

Thanks,

Mar

28 REPLIES 28
atcodedog05
22 - Nova
22 - Nova

Hi @KamenRider 

 

It still works. Can you provide a scenario where it doesn't work.

 

atcodedog05_0-1644847649083.png

 

Hope this helps : )

 

KamenRider
11 - Bolide

Hi @atcodedog05 

 

I'm confused. How come the result is ok with you but mine is that nothing happen. Its results shows the whole path. Is it possible to kindly type the formula so I can copy and paste it to check again with the formula I typed.

 

Thanks,

Mar

atcodedog05
22 - Nova
22 - Nova

Hi @KamenRider 

 

Here is the formula

 

REGEX_Replace([Field1], ".*\|\|\|'(.+)\$'", "$1")

 

Hope this helps : )

KamenRider
11 - Bolide

@atcodedog05 @binuacs 

 

So sad, I am still getting the entire path as the result using this regex_replace formula. The sheet name itself is not being extracted and I don't know really why? I know it's quite annoying but since I tick "output filename as field" in the input tool, will this be the reason why I can't get the actual result?

 

Kamen

binuacs
21 - Polaris

@KamenRider what is the error you are getting when you use the below formula

Trim(Trim(SubString([FilePath],FindString([FilePath], '|')+3,Length([FilePath])),"'"),'$')

 

I tried @atcodedog05 RegeEx formula and it is working fine. 

binuacs
21 - Polaris

@KamenRider also just post your formula from the Formula tool, just wanted to see what would be the error 

KamenRider
11 - Bolide

Guys @binuacs @atcodedog05 

 

Truly I can't locate the error. Upon my reading, I suspect maybe because I've reach the limit of 260 characters. I tried the trim command and it doesn't reach the last word. For @atcodedog05  Reg Ex, the result is the whole full path instead of the sheet name. For @binuacs , it always give me a "null" result.

 

Mar

binuacs
21 - Polaris

@KamenRider can you try with a different path and see you are getting the result?

DylanDowrick
9 - Comet

@KamenRider have you checked with a select tool if your FullPath string field is long enough?

DylanDowrick
9 - Comet

Additionally, if your field is long enough, there is a formula that gets you 90% of the way there: FileGetExt()

Labels
Top Solution Authors