batch_gsub: Batch File Text Replacement

Description Usage Arguments Value See Also

View source: R/batch-gsub.R

Description

Uses batchr::batch_process() and gsub_file() to perform batch text file replacement. By default it replaces text in all .R and .r files in the working directory.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
batch_gsub(
  pattern,
  replacement,
  path,
  regexp = "[.](R|r)$",
  ignore.case = FALSE,
  fixed = FALSE,
  recurse = FALSE,
  progress = FALSE,
  report = TRUE,
  options = furrr::future_options(),
  ask = getOption("batchr.ask", TRUE)
)

Arguments

pattern

A string of the regular expression to match.

replacement

A string of the replacement text.

path

A string of the path to the directory with the files for processing.

regexp

A string of a regular expression. Only non-hidden file names which match the regular expression will be batch processed.

ignore.case

A flag specifying whether to ignore the case.

fixed

A flag specifying whether to match pattern as is (as opposed to as a regular expression).

recurse

A flag specifying whether to recurse into path's subdirectories.

progress

A flag specifying whether to print a progress bar.

report

A flag specifying whether to outputs a report of the status of individual files to the console.

options

The future specific options to use with the workers. seed must be FALSE.

ask

A flag specifying whether to ask before starting to process the files.

Value

An invisible flag indicating whether all the files were successfully processed.

See Also

batchr::batch_process() and gsub_file()


poissonconsulting/batchgsub documentation built on Feb. 13, 2021, 6:20 p.m.