RE: PL/SQL equivalent of unix basename command

  • From: "Ian Cary (C)" <Ian.Cary@xxxxxxxxxxxxxxxxxxxx>
  • To: <jdunn@xxxxxxxxx>, "oracle-l digest users" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 31 Aug 2005 13:24:00 +0100

Assuming you have the directory in a variable dirname say;

substr(dirname,instr(dirname,'\',-1)+1)

would do the trick. 

You could also you regexp if you are on version 10.

Cheers,

Ian

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of John Dunn
Sent: 31 August 2005 13:15
To: 'oracle-l digest users'
Subject: PL/SQL equivalent of unix basename command


Does PL/SQL have an equivalent of the unix basename command, which returns
just the filename part of a full file path?

e.g for C:\dir\file.txt

would return

file.txt

??


--
//www.freelists.org/webpage/oracle-l


This email and any attachments have been virus checked upon receipt at Ordnance 
Survey and are free of all known viruses.



This email is only intended for the person to whom it is addressed and may 
contain confidential information. If you have received this email in error, 
please notify the sender and delete this email which must not be copied, 
distributed or disclosed to any other person.
Unless stated otherwise, the contents of this email are personal to the writer 
and do not represent the official view of Ordnance Survey. Nor can any contract 
be formed on Ordnance Survey's behalf via email. We reserve the right to 
monitor emails and attachments without prior notice.

Thank you for your cooperation.

Ordnance Survey
Romsey Road
Southampton SO16 4GU
Tel: 023 8079 2000
http://www.ordnancesurvey.co.uk

--
//www.freelists.org/webpage/oracle-l

Other related posts: