API Reference
Namespaces
Classes
Events
Global
Externals

Class: CSVReader

CIQ. CSVReader (file)


new CSVReader(file)

Helper class to read loaded web files with a FileReader.

Parameters:
Name Type Description
file external:File

Web file that the CSVReader should parse.

Since:
  • 8.4.0

Members


file :external:File

Type:

reader :external:FileReader

Type:

Methods


determineLineBreak(data)

Determines the line break on the File by checking for carriage and newLine return. Progressively reads 5% ofthe file until it finds a value.

Parameters:
Name Type Description
data string

Raw parsed values from the FileReader

Returns:

Identified line break in the file which will be used to split results

Type
string

<async> parse(file)

Asynchronously parse a File with the FileReader. Determines the linebreak and splits into arrays for fields and data. On resolve returns the results of the file split based on identified line break.

Parameters:
Name Type Description
file external:File

File to passed to the FileReader and parsed.

Returns:

A CSV array of data

Type
Promise.<Array.<string>>

splitResults(data)

Splits data from the FileReader based on determined linebreak.

Parameters:
Name Type Description
data string

Parsed data from FileReader

Returns:

Split data from the FileReader

Type
Array.<string>