Bill
Bill

Reputation: 1247

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

Upvotes: 3

Views: 2600

Answers (1)

Tom Bascom
Tom Bascom

Reputation: 14020

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)"
.

Upvotes: 4

Related Questions