Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The basic form will look like this:

Code Block
languagejs
string [] fileContent = readFromCSVFile("C:/test.csv", true);

However it is hardly usable. A better form will look like this:

Code Block
languagejs
//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'
}

...