Functions > Reading and Writing Files > CSV Data Files
  
CSV Data Files
There are two functions that are used to read from, or write to, comma separated value (CSV) data files:
READCSV("file")—Returns an array containing the comma separated value data in file.
WRITECSV("file", M, [rows, [cols, ["decsymb"]]])—Writes array M to the comma separated values data file file.
Remember that in order to execute, an expression in a PTC Mathcad worksheet must be an assignment or a request for evaluation, as in:
or
Arguments
file is a string containing the filename or the full pathname and filename. Non-absolute pathnames are relative to the current working directory.
M is a matrix of values to write to the specified file.
rows (optional) is either a scalar specifying the first row of matrix M to write, or a 2-element vector specifying the range of rows (inclusive) of matrix M to write. If this argument is omitted, WRITECSV writes out every row of the matrix to the file.
cols (optional) is either a scalar specifying the first column of matrix M to write, or a 2-element vector specifying the range of columns (inclusive) of matrix M to write. If this argument is omitted, WRITECSV writes out every column of the matrix to the file.
decsymb (optional) is the decimal symbol to use. You can specify either a "," (comma) or a "." (dot). The default is "." (dot).
Additional Information
Both rows and cols are indices that start with 1.
ORIGIN does not affect the behavior of READCSV.
You can only omit optional arguments from the last argument and back. For example, in WRITECSV you cannot omit rows and specify cols and decsymb. If rows is omitted, the value of cols will be used as rows.