cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Alex19
Level I

How to cut the string after a SPECIFIC symbol?

I have a column of strings with the full File Path + File Name. I need to isolate specifically the File Name in the next column. Is there a way to do it?

Alex19_2-1681330445473.png

 

Note: I entered the File Name manually.

Thank you all in advance!

Alex.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to cut the string after a SPECIFIC symbol?

word(-1, :File Path, "\/" );

or

reverse(substr(reverse(:File Path),1,contains(reverse(:File Path), "\") -1 ) );
Jim

View solution in original post

3 REPLIES 3
Alex19
Level I

Re: How to cut the string after a SPECIFIC symbol?

A small clarification - as a pseudo-code I'd need something like that: cut string before the first "\" when scanning the string from the right-to-left. My problem is that I can have Path and File Name of variable lengths, so, cannot use "Left" or "Right" functions with the fixed # of characters to isolate...

Alex19_2-1681331298938.png

 

 

 

txnelson
Super User

Re: How to cut the string after a SPECIFIC symbol?

word(-1, :File Path, "\/" );

or

reverse(substr(reverse(:File Path),1,contains(reverse(:File Path), "\") -1 ) );
Jim
Alex19
Level I

Re: How to cut the string after a SPECIFIC symbol?

Oh this is beautiful! Thank you so much!