Qore CsvUtil Module Reference  1.2
 All Classes Namespaces Functions Variables Groups Pages
CsvUtil::CsvFileIterator Class Reference

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

Inheritance diagram for CsvUtil::CsvFileIterator:

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
 

Additional Inherited Members

- Private Member Functions inherited from CsvHelper
private setFields ()
 sets field description list
 

Detailed Description

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

See Also

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
paththe path to the CSV file to read
optsa hash of optional options; see CsvAbstractIterator Constructor Option Hash Overview for more information
Exceptions
CSVABSTRACTITERATOR-ERRORinvalid 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