WRITE_SYLK
The WRITE_SYLK function writes the contents of an IDL variable to a SYLK (Symbolic Link) format spreadsheet data file. SYLK files can be read by common spreadsheet applications like Microsoft Excel.
Note: This routine writes only numeric and string SYLK data. It cannot handle spreadsheet and cell formatting information (cell width, text justification, font type, date, time, monetary notations, etc.). A given SYLK data file cannot be appended with data blocks through subsequent calls.
This routine is written in the IDL language. Its source code can be found in the file write_sylk.pro
in the lib
subdirectory of the IDL distribution.
Examples
Suppose you wish to write the contents of a 2 by 2 floating-point array, data
, to a SYLK data file called “bar.slk
” such that the matrix would appear with it’s upper left data at the cell in the 5th row and the 9th column. Use the following commands to write the file to the temporary directory. Note that the variable status
will contain the value 1 if the operation was successful.
data = [[2.0, 3.8],[1.1, 9.6]]
slk_file = FILEPATH('bar.slk', /TMP)
status = WRITE_SYLK(slk_file, data, STARTROW = 4, STARTCOL = 8)
IF (status) THEN PRINT, 'SLK file written to ', slk_file
Syntax
Result = WRITE_SYLK( File, Data [, STARTCOL=column] [, STARTROW=row] )
Return Value
The function returns TRUE if the write operation was successful.
Arguments
File
A scalar string specifying the full path name of the SYLK file to write.
Data
A scalar, vector, or 2D array to be written to File.
Keywords
STARTCOL
Set this keyword to the first column of spreadsheet cells to write. If not specified, the write operation begins with the first column found in the file (column 0).
STARTROW
Set this keyword to the first row of spreadsheet cells to write. If not specified, the write operation begins with the first row of cells found in the file (row 0).
Version History
4.0 |
Introduced |