reader (version 1.0.6)

rmv.ext: Remove the file extension from a file-name.

Description

Default is to only remove from a known list of file types, this is to protect files with '.' which may not have an extension This option can be changed, and more types can be specified too.

Usage

rmv.ext(fn = NULL, only.known = TRUE, more.known = NULL, print.known = FALSE)

Arguments

fn
filename(s) (with full path is ok too)
only.known
logical, only remove extension if in the 'known' list
more.known
character vector, add to the list of known extensions
print.known
return the list of 'known' file extensions

Value

returns the file name/path without the file extension

See Also

get.ext

Examples

Run this code
rmv.ext(print.known=TRUE)
rmv.ext("/documents/nick/mydoc.xlsx")
rmv.ext(c("temp.cnv","temp.txt","temp.epi"))
# remove anything that looks like an extension
rmv.ext(c("temp.cnv","temp.txt","temp.epi"),only.known=FALSE) 
# add to list of known extensions
rmv.ext(c("temp.cnv","temp.txt","temp.epi"),more.known="epi") 

Run the code above in your browser using DataLab