| title | CSVImport — Core Library |
|---|---|
| package | lib |
| packageTitle | Core Library |
| layout | default |
| className | CSVImport |
| type | class |
Import data from a CSV file
CSVImport is a base class.
uses('csv-import');
$importer = new CSVImport('/path/to/file.csv');
The CSVImport class provides the ability to import data from
CSV files.
CSVImport::__construct(): Initialise aCSVImportinstance.CSVImport::readFields(): Read the list of field names from a CSV file.CSVImport::setFields(): Specify an explicit column-to-field mapping.CSVImport::rewind(): Move the file pointer back to the beginning of the file.CSVImport::rowFlat(): Read a row from the CSV file without mapping columns to fields.CSVImport::row(): Read a row from the CSV file.