README.md

batchgsub

Lifecycle:
deprecated License:
MIT

batchgsub provides a function, Shiny app and RStudio addin for batch replacement of text content in files.

Installation

To install the developmental version from GitHub

# install.packages("remotes")
remotes::install_github("poissonconsulting/batchgsub")

Demonstration

Function

library(batchgsub)

path <- tempdir()
file <- file.path(path, "file1.txt")
writeLines("The quick brown fox jumps over the lazy dog", con = file)
readLines(file)
#> [1] "The quick brown fox jumps over the lazy dog"
batch_gsub("o", "ooo", path = path, regexp = "[.]txt$", ask = FALSE)
#> Warning: `future_options()` is deprecated as of furrr 0.2.0.
#> Please use `furrr_options()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_warnings()` to see where this warning was generated.
#> ✓ file1.txt [00:00:00.000]
#> Success: 1
#> Failure: 0
#> Remaining: 0
#> 
readLines(file)
#> [1] "The quick brooown fooox jumps ooover the lazy dooog"

Shiny App

batchgsub::run_app()

Shiny app

RStudio addin

The RStudio addin opens the Shiny app from the Addins menu.

The RStudio addin allows the user to set a keyboard shortcut to run the Shiny app.

RStudio addin

Contribution

Please report any issues.

Pull requests are always welcome.

Code of Conduct

Please note that the batchgsub project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



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