Re: Extract filename from path



fnam=ary(split(FILENAME,ary,"\\"));
print fnam;

--
pop is Mark
Doing nothing makes me tired 'cause I can't take a break.
--
"Jeroen Gouma" <Jeroen@xxxxxxxxxxxxxx> wrote in message
news:f149n152b8ndjtcua9rusj6eatno2ake19@xxxxxxxxxx
> Hi,
>
> How can I extract only the filename from the FILENAME variable,
> containing the complete path?
>
> i.e.:
> FILENAME = c:\test\input\data.txt
>
> I would like to have only data.txt in a variable.
>
> I was thinking on something like find the last \ in FILENAME and take
> a substr from there. But how to find the last \ if the lenght of the
> path can vary?
>
> Thanks a lot,
>
> Jeroen


.



Relevant Pages

  • Re: Extracting filename from path
    ... Sydney, Australia ... > extract the filename part? ... Prev by Date: ...
    (microsoft.public.access.formscoding)
  • Re: 2 Additional questions
    ... When I read a posting that I want to keep track of--either because I posted it, or the subject is of great interest--I mark it with the eyeglasses. ... I realize I could simply not click on Mark All Read, but that results in a rapid increase in the newsgroup size and a lot of detective work to find the new stuff. ... I'd like the color to be part of the filename, so that it follows the name around from place to place. ... If the conversation is marked as Watched and Outlook Express detects a new post in the watched conversation it will show the newsgroup in red in the Folder List. ...
    (microsoft.public.windowsxp.basics)
  • 2 Additional questions
    ... After I read the entire newsgroup, I click on Mark All Read. ... and remark all the eyeglasses posts as Mark Unread. ... I'd like the color to be part of the filename, ...
    (microsoft.public.windowsxp.basics)
  • Extracting filename from path
    ... Given a directory path string, such as "D:\documents\file1.txt", how do I ... extract the filename part? ... Prev by Date: ...
    (microsoft.public.access.formscoding)
  • [PATCH] cleanup: shmem_file_setup: char * -> const char * for name argument
    ... given filename - mark it as const. ...
    (Linux-Kernel)