newext(3m)

NAME
newext - Change the extension of file names

SYNOPSIS
s = newext(old, new, fname, delim )

DESCRIPTION
Return a string for a file name with a new extension. The extension delimiter can be specified to allow other changes in file names. The following rules take place: item_( For multiple extensions, only the last occurence of old is replaced with new. ) If the string old is not present in fname,the last extension is replaced by new. If the file does not contain any extension,the extension new is appended to it.

PARAMETERS

old String with old extension.

new String with new extension.

fname
    Name of file.

delim optional
    Specifies the extension delimeter to use. Default is '⋅'. If delim is s tring with more than one character,all of them are used as the extension delimiter.

RETURNS
The new file name.

AUTHORS
Pierre Jaccard, Geophysical Institute, University of Bergen, 1999