View source: R/findAndMoveInSequence.R
findAndMoveInSequence | R Documentation |
Find and move files in sequence
findAndMoveInSequence(sourceDir, targetDir, pattern = NULL)
sourceDir |
|
targetDir |
|
pattern |
|
character
.
File paths of renamed files.
Updated 2022-09-08.
testDir <- AcidBase::tempdir2()
sourceDir <- file.path(testDir, "source")
targetDir <- file.path(testDir, "target")
paths <- c(sourceDir, targetDir)
invisible(lapply(X = paths, FUN = dir.create, recursive = TRUE))
invisible(file.create(
file.path(
sourceDir,
paste0(
c("aaa", "bbb", "ccc"),
".txt"
)
)
))
print(sort(list.files(
path = sourceDir,
full.names = FALSE,
recursive = FALSE
)))
out <- findAndMoveInSequence(
sourceDir = sourceDir,
targetDir = targetDir
)
print(out)
print(sort(list.files(
path = targetDir,
full.names = FALSE,
recursive = FALSE
)))
AcidBase::unlink2(testDir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.