comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: extracting all but...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: extracting all but... [message #46305 is a reply to message #46304] Sat, 19 November 2005 01:46 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
kl_tah@hotmail.com wrote:

> Hi All,
>
> I was wondering how I can extract all but a constant string from an
> array of strings?
> basically, I have an array of filenames with a particular directory
> prefixed to each of the filenames like so:
>
> files =
> ['/some/constant/directory/file1','/some/constant/directory/ file2',
> etc.]
>
> and would like to have just an array of the filenames without the
> prefixed directory name so that the result looks like:
>
> files = ['file1', 'file2', etc.]
>
>
> any ideas?
>
> Cheers,
> KL

You could use our file_path_name_ext routine from our library

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/file_path_name_ext_dbase.pro.html

more routines are described here:
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html

idl has in idl6.0 introduced two routines FILE_BASENAME and FILE_DIRNAME.
There is no builtin routine to separate the extension - unfortunately.

file_path_name_ext returns a structure of path,name,ext input could be a
scalar or an array

cheers
Reimar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Version control for IDL software
Next Topic: Re: extracting strings between ' '

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:17:35 PDT 2025

Total time taken to generate the page: 0.96189 seconds