Writecsv
Jump to navigation
Jump to search
Purpose
Export a DataSet object to a comma-separated values (CSV) file.
Synopsis
- writecsv(x)
- writecsv(x,filename)
- writecsv(x,filename,options)
Description
Exports a comma-separated values text file based on the contents of a DataSet object. The csv file will include any axisscale, class, label and include information contained in the file as well as author, description, name and date details.
Inputs are the dataset to export (x) and an optional filename (filename). If filename is omitted, the user is prompted for an output filename.
Note that although the CSV file output is not directly readable by XCLREADR, an XLS file created by Excel from the CSV file will be readable by XLSREADR (i.e. read the CSV file into Excel, then save as XLS. The output XLS file will be readable by XLSREADR).
Inputs
Dataset to export (x)
Optional Inputs
Optional inputs:
- filename = output filename to write CSV file. If filename is omitted, the user is prompted for an output filename.
- options = an options structure containing the following fields:
- detailToInclude : [ {'full'} | 'limited' | 'none' ]. Governs the amount of detail that is exported. The default is 'full' and will export all meta data including header information. 'limited' will not export header information; only label, class, axis scale, and included meta data.'none' will export just the data and no meta data.
Outputs
- None
Example
- load arch
- filename = 'testwrite2.csv';
- writecsv(arch,filename);