Extracting File Basename without Extension
On 1/8/2009 9:10 PM, Gundala Viswanath wrote:
Dear all, The basename() function returns the extension also:
myfile <- "path1/path2/myoutput.txt" basename(myfile)
[1] "myoutput.txt" Is there any other function where it just returns plain base: "myoutput" i.e. without 'txt'
I'm curious about something: does "file extension" have a standard definition? Most (all? I haven't tried them all) of the solutions presented in this thread would return an empty string for the "plain base" if given the filename ".bashrc". Windows (where file extensions really mean something), though reluctant to create such a file, appears to agree that the extension is bashrc, even though to me it appears clear that that file has no extension. Duncan Murdoch