file.writeLines

file.writeLines Writes an array of lines to a file
Usage
file.writeLines [-l] [-a] [-c] <filename:string> <lines:array>
Description
Writes the array of <lines> to the specified file, separated by a single linefeed character (see also $lf) unless the -c or -n switches are used. If the file already exists then it is overwritten with the new data unless the -a switch is used. The lines array is encoded in the UTF-8 character set unless the -l switch is used.
Switches

-l | --local-8-bit
Causes the lines to be saved in local 8-bit character set instead of the default Unicode encoding.
-a | --append
If the file already exists, then the lines are appended to the end instead of overwriting the file.
-c | --crlf
The lines are separated by a carriage-return+line-feed character combination, compatible with Windows text mode files. For reference, this is the only way to make the file readable in Windows Notepad. Please note that this is broken design: do not use it :)
-n | --no-separator
Do not separate the lines at all (either the separators are already inside the lines array or no line separation is desired at all). -n takes precedence over -c.
-q | --quiet
Don't complain if the file can't be opened: just fail silently

See also
$file.readlines

Index, Commands