Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


AnalysisPageServer (version 1.6.2)

search.replace: search.replace

Description

Search and replace strings in a file

Usage

search.replace(infile, outfile, replacements, overwrite = FALSE)

Arguments

infile
Path to input file
outfile
Path to output file (must be different)
replacements
Named charvec of length 1 (single replacement) or 2 (double replacement)
overwrite
Boolean. If FALSE then outfile must not yet exist. If TRUE and it already exists then it will be overwritten.

Value

Nothing, but might throw an error.

Details

This is a very limited interface and only meant for internal use.

It will replace all occurances of a string with another string. It may do 1 or 2 replacements.

The result is written to a second file.

This is done in C++ so very fast (I hope).