|Download Help (Windows Only)|
Owning Class: support
Requires: MathScript RT Module
m = fread_csv(file)
m = fread_csv(file, range)
m = fread_csv(file, row, col)
Reads a file of values that are separated by commas and returns these values as a matrix.
|file||Specifies the file you want to read. The data in the file must be organized as a matrix. file is a string.|
|range||Specifies the range of the data you want to read. range is a four-element vector or a string. If range is a four-element vector, each element represents a row or column coordinate. The first two coordinates specify the row and column where the data begins, and the last two coordinates specify the row and column where the data ends. If range is a string, use spreadsheet notation to specify where the data begins and ends, for instance 'A1..B3'.|
|row, col||Specify the location at which you want to start reading the data. row and col are zero-based.|
|m||Returns the matrix of values.|
If you use this function in a stand-alone application or shared library and file is a relative path, LabVIEW searches for the file in the path where you installed the application or shared library. If file is an absolute path, LabVIEW searches for the file on the local machine or target at the specified location. (Real-Time Module) If you deploy this function to an RT target and file is a relative path, LabVIEW searches for the file in the path returned by the Default Data Directory VI.
The following table lists the support characteristics of this function.
|Supported in the LabVIEW Run-Time Engine||Yes|
|Supported on RT targets||Yes|
|Suitable for bounded execution times on RT||No (affects entire script)|
In the following example, LabVIEW creates test.csv in the LabVIEW Data directory. LabVIEW then reads the values in test.csv and returns these values as a matrix.fwrite_csv('test', magic(5), 2, 2);