fnExtension {NMdata}R 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")

[Package NMdata version 0.1.6 Index]