normalizeFilename: Normalize filename string
Description
Remove all reserved characters from the file name.Usage
normalizeFilename(x, form = c("default", "8.3")[1],
fix.encoding = TRUE, sub.sign = "_")
Arguments
form
target format (standard or the short 8.3 file name)
fix.encoding
logical; specifies whether to fix the encoding
sub.sign
substitution symbol
Details
This function removes all http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx{reserved characters}: (less than), (greater than), (colon), (double quote), (forward slash), (backslash), (vertical bar or pipe), (question mark), (asterisk), and empty spaces, from the file name. This is important when writing a list of objects to an external file (e.g. KML) as it prevents from creating erroneous file names.See Also
utils::shortPathName
, RSAGA:set.file.extension
Examples
Run this codenormalizeFilename("name[%].txt")
normalizeFilename("name .txt")
Run the code above in your browser using DataLab