Table of Contents

OIL2 Class Local.ReadCSVfile


class Local . ReadCSVfile {
        array   columnNames;
        set     everyIndex;
        array   records;
        int32   recordsRead;
        assoc   valuesInCol;
inherits from Object;

DESCRIPTION

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.

METHODS


Local.ReadCSVfile:create

ReadCSVfile:create(string fileName)

Method Description

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.


Local.ReadCSVfile:selectRecords

ReadCSVfile:selectRecords(assoc query)

Method Description

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.

Return Value

An array of result records is returned.