read_csv — Read comma-separated value file
M = csv_read(filename [, separator [,decimal [,conversion]]])
a character string. The file path.
a character string. Field separator used, default value is ","
a character string. Field decimal used, default value is "."
a character string. Field conversion used ("string" or "double"), default value is "string"
a matrix of strings or double.
Given an ascii file with delimited fields, for instance created by a spreadsheet using "Text and comma" format, csv_read(filename) returns the corresponding Scilab matrix of strings. Use csv_read(filename, separator) for another choice of separator.
with parameter "conversion" equals to "double" strings are converted as NaN.
// create a file with some data separated with tab A = 1:50; csv_write(A, TMPDIR + '/foo.csv', ascii(9), '.') mgetl(TMPDIR + '/foo.csv') // read csv file B = csv_read(TMPDIR + '/foo.csv',ascii(9)) // as double C = csv_read(TMPDIR + '/foo.csv',ascii(9), '.', 'double') // compares original data and result and(A == C)