Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding the base file name

What the easiest way to find the base filename in progress.

I have:

 /tmp/admin/run/test.txt

and I want:

 test.txt

10.2b

like image 424
Bill Avatar asked Nov 30 '25 20:11

Bill


1 Answers

Use the R-INDEX() function to find the right-most "/".

define variable path as character no-undo initial "/tmp/admin/run/test.txt".

display
  path format "x(60)" skip 
  substring( path, r-index( path, "/" ) + 1 ) format "x(60)"
.
like image 172
Tom Bascom Avatar answered Dec 02 '25 13:12

Tom Bascom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!