Name

csv_write — Read comma-separated value file

Calling Sequence

csv_write(M, filename[, separator, decimal]) 

Parameters

filename

a character string. The file path.

M

a matrix of strings or double (not complex).

separator

column separator mark, by default a tabulation: ","

dec

decimal mark '.' or ',' by default a '.'

Description

csv_write(M, filename) writes matrix M into filename as comma-separated values. The filename input is a string.

if the file 'filename' already exists, it is overwritten.

Examples

// save a matrix as csv file format
A = [1:10] * 0.1;
csv_write(A, TMPDIR + '/datas.csv');

// read as text
mgetl(TMPDIR + '/datas.csv')

r = csv_read(TMPDIR + '/datas.csv');

r = csv_read(TMPDIR + '/datas.csv', ",", ".", "string")

r = csv_read(TMPDIR + '/datas.csv', ",", ".", "double")

See Also

csv_read

Authors

Allan CORNET