Writes text to a file, optionally including a header at the top of the file. Text and header are converted from Linux newline format to Windows newline format before writing.
write_text(
txt,
file = "",
header = "**THIS FILE IS CONSTANTLY OVERWRITTEN -- DO NOT MANUALLY EDIT**\r\n\r\n"
)A character string of text to be written to the file.
A character string specifying the file path. Passed through to base::cat.
Default is an empty string, which writes to the console.
An optional character string header to be inserted at the top of the text file.
Default is **THIS FILE IS CONSTANTLY OVERWRITTEN -- DO NOT MANUALLY EDIT**\r\n\r\n.
No return value. Called for its side effect of writing to a file.
if (FALSE) { # \dontrun{
org::write_text("Sample text", "output.txt")
org::write_text("Another piece of text", "output.txt", "Custom Header\r\n\r\n")
} # }