Skip to content

CSVParser

Members

Constructors

Properties

Methods


CSVParser

Constructor

Arguments

Arguments Default Description
target   Target to forward events to. If omitted, events are sent to this object.
separator   Separator character. Defaults to ",".
newline   Newline character used in data when a field spans lines. Defaults to "\r\n".

Description

Constructor


currentLineNumber

Property \ Access: r/w

Description

Gets the number of the line processed so far


init

Method

Arguments

Arguments Default Description
text   Text.

Description

Initializes the text to process


initStorage

Method

Arguments

Arguments Default Description
filename   File name of the text.
readmode false Read mode.
typeof readmode == "String" : reads the text the same way as Array.load
typeof readmode == "Integer" : true reads as UTF-8; otherwise reads as CP_ACP text
Note: if the plugin is compiled with /D:CSVPARSER_DEFAULT_TEXTSTREAM=1, readmode='' becomes the default when omitted.

Description

Initializes the text to process


getNextLine

Method

Return value

Column data (Array).

Description

Gets the next line as an array


parse

Method

Arguments

Arguments Default Description
text   Text. If omitted, the currently set text is parsed.

Description

Parses text

Calls the doLine() event for each line.


parseStorage

Method

Arguments

Arguments Default Description
filename   File name of the text.
readmode   Read mode (see initStorage for details).

Description

Parses text


doLine

Method

Arguments

Arguments Default Description
columns   Column data (Array).
lineNo   Logical line number (starting at 1).

Description

Event called from parse/parseStorage