runsed | R Documentation |
This function mimics the runsed
script published in Unix
Power Tools.
runsed(files, pattern, replacement)
files |
A list of file names in which to replace. |
pattern |
A regex pattern, see |
replacement |
A string, see |
Invisibly
the vector of names of files
changed.
Shelley Powers, Jerry Peek, Tim O'Reilly and Mike Loukides, 2002, Unix Power Tools, 3rd edition, O'Reilly Media, Inc.
Other file utilities:
clipboard_path()
,
delete_trailing_blank_lines()
,
delete_trailing_whitespace()
,
develop_test()
,
file_copy()
,
file_modified_last()
,
file_save()
,
file_string()
,
find_files()
,
get_lines_between_tags()
,
get_mtime()
,
get_unique_string()
,
grep_file()
,
is_files_current()
,
is_path()
,
paths
,
search_files()
,
split_code_file()
,
touch()
Other searching functions:
compare_vectors()
,
file_modified_last()
,
find_files()
,
fromto()
,
grep_file()
,
missing_docs
,
search_files()
,
search_rows()
,
summary.filesearch()
source_files <- list.files(system.file(package = "fritools", "source", "R"),
pattern = ".*\\.R$", full.names = TRUE)
file.copy(source_files, tempdir(), overwrite = TRUE)
files <- find_files(file_names = file.path(tempdir(),
basename(source_files)))
print(f <- runsed(files, pattern = "_clean", replacement = "_cleanr"))
print(f <- runsed(files, pattern = "_cleanr\\>", replacement = "_cleaner"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.