cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Alex19
Level II

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 II

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 II

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

Oh this is beautiful! Thank you so much!

Recommended Articles