class Local . ReadCSVfile {
array columnNames;
set everyIndex;
array records;
int32 recordsRead;
assoc valuesInCol;
} inherits from Object;
A Microsoft Excel spreadsheet in comma-separated value (CSV) format can be processed by objects of class ReadCSVfile. The processed data can be treated as a simple database and searched using functionality similar to an SQL SELECT statement. The first row of the file is treated as column names.
ReadCSVfile:create(string fileName)
The name of the file to be processed should be provided as the single argument to the create method. The fileName is passed as an argument to a ReadAndProcessFile object.
ReadCSVfile:selectRecords(assoc query)
Searches against the data can be performed with the selectRecords method. The single argument is an associative array of search constraints that are represented as attribute/value pairs. The subscript key identifies a column name; the corresponding value can either be "*", which matches every row or a value that must be matched in the selected column.