Qore CsvUtil Module Reference: CsvUtil::CsvFileIterator Class Reference

Qore CsvUtil Module Reference 1.3

- Main Page
- Related Pages
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Groups Pages
Public Member Functions | List of all members
CsvUtil::CsvFileIterator Class Reference

the CsvFileIterator class allows CSV files to be iterated on a record basis More...

Inheritance diagram for CsvUtil::CsvFileIterator:
[legend]

## Public Member Functions
| constructor (string path, *hash opts)
| creates the CsvFileIterator with the path of the file to read and optionally an option hash More...
private *string | getDataName ()
| Returns the name of the input data.
private string | getLineValueImpl ()
| Returns the current line trimmed of the EOL character(s)
private int | lineNumberImpl ()
| Returns the current line number.
private bool | nextLineImpl ()
| Moves the current line / record position to the next line / record; returns False if there are no more lines to iterate.
Public Member Functions inherited from CsvUtil::CsvAbstractIterator
| constructor (*hash opts)
| creates the CsvAbstractIterator with an option hash More...
private *string | getDataName ()
| Returns the name of the input data.
*list | getHeaders ()
| returns the current column headers or NOTHING if no headers have been detected or saved yet More...
string | getQuote ()
| returns the current quote string More...
hash | getRecord ()
| returns the current record as a hash More...
list | getRecordList ()
| returns the current record as a list More...
string | getSeparator ()
| returns the current separator string More...
hash | getValue ()
| returns the current record as a hash More...
int | index ()
| returns the row index being iterated, which does not necessarily correspond to the line number when there are header rows and blank lines are skipped More...
int | lineNumber ()
| returns the current iterator line number in the file (the first line is line 1) or 0 if not pointing at a valid element More...
any | memberGate (string name)
| returns the given column value for the current row More...
bool | next ()
| Moves the current line / record position to the next line / record; returns False if there are no more lines to iterate. More...
private list | parseLine ()
| parses a line in the file and returns a processed list of the fields

## Detailed Description

the CsvFileIterator class allows CSV files to be iterated on a record basis

See Also
  - CsvAbstractIterator Constructor Option Hash Overview
  - Option Field Types
  - Option Field Hash

## Member Function Documentation

CsvUtil::CsvFileIterator::constructor | ( | string | path,
|  | *hash | opts
| ) |  |

creates the CsvFileIterator with the path of the file to read and optionally an option hash

Parameters

  path | the path to the CSV file to read
  opts | a hash of optional options; see CsvAbstractIterator Constructor Option Hash Overview for more information

Exceptions

  CSVABSTRACTITERATOR-ERROR | invalid or unknown option; invalid data type for option; `"header-names"` is True and `"header-lines"` is 0 or `"headers"` is also present; unknown field type