Description Usage Arguments Details Value Author(s)
execute a perl one liner, such as a regex search & replace (which is how
i most often use this), eg s|^.+\t||
and execute it on the
cmdline.
1 | perl.oneliner(cmds, files, intern = FALSE, debug = FALSE)
|
cmds |
a character vector of commands |
files |
a character vector of paths to files. It is recyled to match the length of cmds |
intern |
logical: capture the output of the command as an R character vector? |
debug |
logical: if |
you can pass in multiple commands (such as multiple regex search/replace strings) applied to one or multiple files. i've tested the usage of multiple regex commands applied to a single file.
commands
The commands vector can either contain the leading perl command, eg
perl.oneliner("perl -pi -e 's|<DTG|\n <DTG|g'", file)
or just a pattern, eg
perl.oneliner("'s|<DTG|\n <DTG|g'", file)
in which case we will add the leading perl -pi -e
nothing
Mark Cowley
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.