fnExtension: Change file name extension

View source: R/fnExtension.R

fnExtensionR Documentation

Change file name extension

Description

Very simple but often applicable function to retrieve or change the file name extension (from say file.lst to file.mod)

Usage

fnExtension(fn, ext)

Arguments

fn

file name. Often ending in an extension after a period but the extension is not needed.

ext

new file name extension. If omitted or NULL, the extension of fn is returned.

Value

A text string

Examples

fnExtension("file.lst",".mod")
fnExtension("file.lst","mod")
fnExtension("file.lst","..mod")
fnExtension("file.lst",cc(.mod,xml))
fnExtension(cc(file1.lst,file2.lst),cc(.xml))
fnExtension(cc(file1.lst,file2.lst),cc(.xml,.cov))
fnExtension("file.lst","")
fnExtension("file.lst")

NMdata documentation built on Nov. 11, 2023, 5:07 p.m.