Learn R Programming

wrMisc (version 1.15.3.1)

.doubleExt: Return File-name Extensions Including Double Extensions (eg txt.gz)

Description

This function allows retreiving extensions to filenames similar to file_ext, but also alllows to retreive selected double-extensions (txt.gz). The leading dor will ne excluded similar to file_ext

Usage

.doubleExt(fiNa, termExt = c("gz", "zip"))

Value

This function returns a character vector with file-extensions (excluding the leading dot). (Only purely alphanumeric extensions are recognized.)

Arguments

fiNa

(character) name of file to be tested (may include path)

termExt

(character) additional terminal extensions

Details

The argument termExt allows specifying additional (terminal) extensions to be recognized.

See Also

file_ext, checkFilePath

Examples

Run this code
fi <- c("ab","ab.c","ab.c.gz","ab.d","ab.d.zip","ab.e")
.doubleExt(fi)

Run the code above in your browser using DataLab