ILNumerics - Custom CSV Files
Complex numbers
Reading complex numbers from CSV files are supported internally from version 4.8. The conversion is automatically done, reading them were never easier:
Custom formats
It is possible to read custom formatted values, custom types from comma seperated text files with ILMath.csvread<T>(). To ensure such functionality, there is a delegate method called 'CSVConvertElement<T>(string element, IFormatProvider culture)'.
The following example demonstrates how to read custom formatted geo coordinates from a CSV file. Let say the format for each element is stored as follows: 'LATITUDE|LONGITUDE|ALTITUDE'. Where the separator is '|', and the elements are stored as double values.
After the parsing method is written, just add the name of custom delegate method to the last argument of the 'csvread' method. The following code reads the CSV file, and converts every element with the help of the the custom method: