Skip to content

Instantly share code, notes, and snippets.

View carrollrm's full-sized avatar

Rachel Carroll carrollrm

View GitHub Profile
@mages
mages / gist:1544009
Created December 31, 2011 13:30
Search and replace string across files with R
## The following example demonstrates
## how a serach and replace string task
## can be peformed with R across several files
## Create two text files with content
filenames <- c( tempfile(), tempfile() )
for( f in filenames ){
cat("We wish you a Merry Christmas!\n\nBest regards\n", file=f)
}