...
readFromCSVFile(path, hasHeader [, charset])
Description
Excerpt |
---|
Read Reads the values from the CSV filemfile, returning them into to an array, of N rows * M columns values. |
Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
path | string | Yes | 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.
Example
On it's The basic form , the routine can be used like simplywill look like this:
Code Block |
---|
string [] fileContent = readFromCSVFile("C:/test.csv", true); |
However , in its bare form it is hardly usable. A better usage is exemplified belowform will look like this:
Code Block |
---|
//Suppose we have a CSV file with 3 columns, First Name, Last Name, Age struct Emp { string fName; string lName; number age; } Emp [] fileContent = readFromCSVFile("C:/test.csv", true); for(Emp e in fileContent) { //we can address them now in a better way .... so process row after row string s = e.fName + " " + e.lName + " / " + e.age; //do smth with that 's' } |
Unless calendaristic Unless calendar dates are in formats SIL can understand, dates should be imported as strings and further parsed afterwards in your SIL program.
...
Note |
---|
|
...