-
-
Notifications
You must be signed in to change notification settings - Fork 36
writeToCsv
Julian Halliwell edited this page Sep 20, 2021
·
4 revisions
Write a spreadsheet object to a CSV file.
writeToCsv( workbook, filepath [, overwrite [, delimiter, [ includeHeaderRow, [ headerRow ] ] ] ] )
-
workbook
spreadsheet object -
filepath
string: the absolute path of the CSV file to be written.
-
overwrite
boolean default=false: whether to overwrite an existing file -
delimiter
string default=",": the single delimiter used in the CSV to separate the fields. For tab delimited data, use\t
ortab
or#Chr( 9 )#
. -
includeHeaderRow
boolean default=true: whether to include the sheet header row in the CSV. -
headerRow
numeric default=1: the sheet's header row
Chainable? Yes.
data = QueryNew( "First,Last", "VarChar,VarChar", [ [ "Susi","Sorglos" ], [ "Frumpo","McNugget" ] ] );
spreadsheet = New spreadsheet();
workbook = spreadsheet.workbookFromQuery( data );
path = "C:/temp/test.csv";
spreadsheet.writeToCsv( workbook, path );