Cprime Apps has been rebranded as Anova Apps. Please note the only effect is the company name - all of our products’ names, logos, functionalities, support, etc. is exactly the same. The new location to our documentation space is https://anovaapps.atlassian.net.
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.