This routine is available starting with SIL Engine™ 4.0.8.
readFromCSVFile(path, hasHeader [, charset])
DescriptionReads the values from the CSV file, returning them to an array, of N rows * M columns values.
Specifies the file name to read from.
|hasHeader||boolean||Yes||Specifies if the file has header.|
|charset||string||No||Specifies the charset used to read that file.|
The values from the file, as a string array.
The basic form will look like this:
However it is hardly usable. A better form will look like this:
Unless calendar dates are in formats SIL can understand, dates should be imported as strings and further parsed afterwards in your SIL program.
- You can use absolute paths and relative paths to "sil.home".
- If the header exist, it must not have duplicated columns, otherwise you need to skip it manually.
- If the file is not found, an error will be raised.