Skip to content
Julian Halliwell edited this page Apr 11, 2017 · 7 revisions

Returns a workbook object from a csv string or a file containing one.

workbookFromCsv( csv, filepath[, firstRowIsHeader[, boldHeaderRow[, trim [, xmlFormat[, delimiter ] ] ] ] ] )

Required arguments

  • csv string: the data in CSV format OR
  • filepath string: full filesystem path of a file containing CSV data

Optional arguments

  • firstRowIsHeader boolean default=false: whether the first line of the CSV contains the column names to use in the query
  • boldHeaderRow boolean default=true: whether to make the header row bold
  • trim boolean default=true: whether white space should be removed from the beginning and end of the CSV string
  • xmlformat boolean default=false: whether to create an XML spreadsheet (.xlsx)
  • delimiter string: default=","_: the single used in the CSV to separate the fields

Example

spreadsheet = New spreadsheet();
savecontent variable="csv"{
  WriteOutput( '
Name,Phone
"Frumpo McNugget",12345
' );
};
spreadsheetObject = spreadsheet.workbookFromCsv( csv=csv, firstRowIsHeader=true );
Clone this wiki locally