-
Notifications
You must be signed in to change notification settings - Fork 6
csv
- CSV.CSV
- CSV.clear
- CSV.csv
- CSV.fromCSV
- CSV.readFile
- CSV.setSeparator
- CSV.setStringDelimiter
- CSV.toCsv
- CSV.w
- CSV.writeFile
CSV.CSV(aCsvString)
Creates a new instance of the CSV object. Optionally you can provide a string that contains a CSV.
CSV.clear()
Clears all internal structures. This will clear all data stored previously in this instance.
CSV.csv() : Array
Returns a javascript array of maps with the current internal CSV representation.
CSV.fromCSV(aCSVString)
Tries to convert aCSVString into an internal csv format.
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(aSeparator)
Sets the default separator to use when building a CSV output (default is ;)
CSV.setStringDelimiter(aDelimiter)
Sets the default string delimited to use when building a CSV output (default is ")
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() : String
Returns the current CSV internal representation in the form of a string.
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.