Learn R Programming

umx (version 1.9.1)

umx_rename_file: umx_rename_file

Description

rename files. On OS X, the function can access the current front-most Finder window. The file renaming is fast and, because you can use regular expressions, powerful

Usage

umx_rename_file(findStr = NA, replaceStr = NA, baseFolder = "Finder",
  listPattern = NA, test = TRUE, overwrite = FALSE)

Arguments

findStr

The (regex) string to find, i.e., "c[ao]t"

replaceStr

The (regex) replacement string "\1 are not dogs"

baseFolder

The folder to search in. If set to "Finder" (and you are on OS X) it will use the current front-most Finder window. If it is blank, a choose folder dialog will be thrown.

listPattern

A pre-filter for files

test

Boolean determining whether to change files on disk, or just report on what would have happened (Defaults to test = TRUE)

overwrite

Boolean determining if an existing file will be overwritten (Defaults to the safe FALSE)

Value

-

References

- http://www.github.com/tbates/umx

See Also

Other File Functions: dl_from_dropbox, umx_make_sql_from_excel, umx_move_file, umx_open, umx

Examples

Run this code
# NOT RUN {
umx_rename_file(baseFolder = "~/Downloads/", findStr = "", replaceStr = "", test = TRUE)
umx_rename_file("[Ss]eason +([0-9]+)", replaceStr="S\1", baseFolder = "Finder", test = TRUE)
# }

Run the code above in your browser using DataLab