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 #46300] Sat, 19 November 2005 15:12 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:

> Reimar Bauer writes:
>
>> idl has in idl6.0 introduced two routines FILE_BASENAME and FILE_DIRNAME.
>> There is no builtin routine to separate the extension - unfortunately.
>
> Well, I'll offer up FSC_BASE_FILENAME, which can give you the
> directory, the filename, and the extension all in one go:
>
> ; EXAMPLE:
> ;
> ; IDL> thePath = "C:\rsi\idl7.8\lib\jester.pro"
> ; IDL> Print, FSC_Base_Filename(thePath, Directory=dir,Extension=ext)
> ; jester
> ; IDL> Print, dir
> ; C:\rsi\idl7.8\lib\
> ; IDL> Print, ext
> ; pro
>
> You can find it here:
>
> http://www.dfanning.com/programs/fsc_base_filename.pro
>
> Cheers,
>
> David


David,
your routine does not get the extension on this example in opposite of Theos
file_path_name_ext which works on windows and unix.
FSC_Base_Filename drops the dot :-(


IDL> thePath = '../.profile'
IDL> Print, FSC_Base_Filename(thePath, Directory=dir,Extension=ext)
% Compiled module: FSC_BASE_FILENAME.
% Compiled module: PATH_SEP.
% Compiled module: STRSPLIT.
profile
IDL> fpe=file_path_name_ext(thePath)
% Compiled module: FILE_PATH_NAME_EXT.
% Compiled module: REPLACE_STRING.
IDL> print,fpe.path
../
IDL> print,fpe.name

IDL> print,fpe.ext
.profile


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: Wed Oct 08 17:35:49 PDT 2025

Total time taken to generate the page: 0.00392 seconds