-
-
Notifications
You must be signed in to change notification settings - Fork 39
workbookFromCsv
Julian Halliwell edited this page Sep 20, 2021
·
7 revisions
Returns a workbook object from a csv string or a file containing one.
workbookFromCsv( csv, filepath[, firstRowIsHeader[, boldHeaderRow[, trim [, xmlFormat[, delimiter ] ] ] ] ] )
-
csvstring: the data in CSV format OR -
filepathstring: full filesystem path of a file containing CSV data
-
firstRowIsHeaderboolean default=false: whether the first line of the CSV contains the column names to use in the query -
boldHeaderRowboolean default=true: whether to make the header row bold -
trimboolean default=true: whether white space should be removed from the beginning and end of the CSV string -
xmlformatboolean default=false: whether to create an XML spreadsheet (.xlsx) -
delimiterstring default=",": the single delimiter used in the CSV to separate the fields. For tab delimited data, use\tortabor#Chr( 9 )#.
Chainable? Yes, using spreadsheet.newChainable().fromCsv().
spreadsheet = New spreadsheet();
savecontent variable="csv"{
WriteOutput( '
Name,Phone
"Frumpo McNugget",12345
' );
};
spreadsheetObject = spreadsheet.workbookFromCsv( csv=csv, firstRowIsHeader=true );