Description: This function is used to replace tags in template files.
Usage
ReplaceTagsInFile(strFileName, vTags, vReplace)
Arguments
- strFileName
The name of the file to use as input. In tags, defined by tags, will be replaced with the corresponding values.
- vTags
Vector of tag names, eg FUNCTION_NAME, VARIABLE_NAME that will be replaced with the values in vReplace
- vreplace
Vector of values to replace the tags with.
Value
A TRUE/FALSE value if the functions was successful.
Examples
if (FALSE) {
vTags <- c("FUNCTION_NAME", "CREATION_DATE")
vReplace <- c(strNewFunctionName, strToday)
strFileName <- "MyTemplate.R" # A file that contains {{FUNCTION_NAME}} and {{CREATION_DATE}}
ReplaceTagsInFile( strFileName, vTags, vReplace )}