WRITE_CSV
Syntax | Arguments | Keywords | Version History | See Also
The WRITE_CSV procedure writes data to a "comma-separated value" (comma-delimited) text file consisting of columns of data.
This routine writes CSV files consisting of an optional line of column headers, followed by columnar data, with commas separating each field. Each row is a new record.
This routine is written in the IDL language. Its source code can be found in the file write_csv.pro in the lib subdirectory of the IDL distribution.
Syntax
WRITE_CSV, Filename, Data1 [, Data2,..., Data8] [, HEADER=variable]
Arguments
Filename
A scalar string containing the full pathname of the CSV file to write.
Data1...Data8
The data values to be written out to the CSV file. The data arguments can have the following forms:
- Data1 can be an IDL structure in which each field contains a vector of data that corresponds to a separate column in the output file. The vectors must all have the same number of elements, but can have different data types. If Data1 is an IDL structure, all other Data arguments are ignored.
- Data1 can be a two-dimensional array in which each column in the array corresponds to a separate column in the output file. If Data1 is a two-dimensional array, all other Data arguments are ignored.
- Data1...Data8 can be vectors, where each vector corresponds to a separate column in the output file. The vectors must all have the same number of elements, but can have different data types.
Keywords
HEADER
Set this keyword equal to a string array containing the column header names. The number of elements in HEADER must match the number of columns provided in Data1...Data8. If HEADER is not present, then no header row is written.
Version History
See Also
QUERY_ASCII, QUERY_CSV, READ_ASCII, READ_CSV