An R package with tools for stream editing: manipulating text files with insertions, replacements, deletions, substitutions, and comments. You can find package vignettes and documentation here.
Sego LH. 2016. rsed: Stream editing in R. Pacific Northwest National Laboratory. https://pnnl.github.io/rsed.
You can install the package from CRAN or from GitHub:
install.packages("rsed")
# If devtools is not already installed, do this:
install.packages("devtools")
# Now install the package
devtools::install_github("pnnl/rsed")
This package was developed with support from the Signature Discovery Initiative at Pacific Northwest National Laboratory, conducted under the Laboratory Directed Research and Development Program at PNNL, a multiprogram national laboratory operated by Battelle for the U.S. Department of Energy.