Skip to content
Nuno Aguiar edited this page Dec 29, 2017 · 2 revisions

CSV.CSV

CSV.CSV(aCsvString)

Creates a new instance of the CSV object. Optionally you can provide a string that contains a CSV.


CSV.clear

CSV.clear()

Clears all internal structures. This will clear all data stored previously in this instance.


CSV.csv

CSV.csv() : Array

Returns a javascript array of maps with the current internal CSV representation.


CSV.fromCSV

CSV.fromCSV(aCSVString)

Tries to convert aCSVString into an internal csv format.


CSV.readFile

CSV.readFile(aFilename) : Number

Tries to read aFilename into the internal CSV representation. If successful the number of read lines will be returned. Otherwise an exception will be raised.


CSV.setSeparator

CSV.setSeparator(aSeparator)

Sets the default separator to use when building a CSV output (default is ;)


CSV.setStringDelimiter

CSV.setStringDelimiter(aDelimiter)

Sets the default string delimited to use when building a CSV output (default is ")


CSV.toCsv

CSV.toCsv(anArrayOfMaps, anArrayOfKeys)

Tries to convert a javascript anArrayOfMaps into an internal csv format. The array should be composed of maps whose elements must have the same keys (example: [ { "F1": 1, "F2": abc}, { "F1": 2, "F2": xyz } ]). Optionally anArrayOfKeys can be provided to restrict the keys used and to force their order.


CSV.w

CSV.w() : String

Returns the current CSV internal representation in the form of a string.


CSV.writeFile

CSV.writeFile(aFilename) : Number

Tries to write the internal CSV representation into aFilename. If successful it will return the number of lines written, otherwise an exception will be raised.

Clone this wiki locally