Skip to content
Back to formatted view

Raw Message

Message-ID: <CAAjnpdiQtHcxcW1WLZbRwKGy7Qhw=VbV9CyJcDPcucs8BaxNUA@mail.gmail.com>
Date: 2013-07-15T14:53:05Z
From: Witold E Wolski
Subject: file.stem?
In-Reply-To: <51E4080A.90508@sapo.pt>

Rui, Thank you

On 15 July 2013 16:32, Rui Barradas <ruipbarradas at sapo.pt> wrote:
> Hello,
>
> You can use ?basename to write a file.stem function:
>
>
> basename("/the/path/to/afile.txt")
>
> file.stem <- function(x){
>         bn <- basename(x)
>         gsub("\\..*$", "", bn)
> }
> file.stem("/the/path/to/afile.txt")
>
>
>
> Hope this helps,
>
> Rui Barradas
>
> Em 15-07-2013 15:23, Witold E Wolski escreveu:
>
>> Looking for a function which returns the stem of the filename given a
>> path.
>> i.e.
>>>
>>> file.stem("/the/path/to/afile.txt")
>>> afile
>>
>>
>> regards
>>
>



-- 
Witold Eryk Wolski