R - how can I dump contents of file to console output?
You have to specify a length (which can be too big), but maybe readChar
would help:
cat(readChar(filename, 1e5))
You could use system
to call a system command.
system("cat yourfile.txt")
Use writeLines
instead of print
. The default con
for writeLines
is stdout()
, so writeLines(readLines(...))
sounds right.
See ?writeLines
.