Skip to content
Jas edited this page Mar 6, 2017 · 1 revision

CSV File Reader and Writer

This library provides additional functionality on top of the standard 0: function provided within kdb+.

Loading CSVs

.csv.load loads a CSV with the following changes:

  1. All empty lines and lines beginning with a comment character / are ignored
  2. CSV is checked to ensure there are the correct number of entries per line for the types specified

.csv.parse

This function is used by .csv.load to convert the data into a kdb table. It is provided as a separate function to parse CSV data if received in a different way (e.g. via HTTP).

Writing CSVs

.csv.write takes the path and some table data and writes it into CSV format. The following checks are performed prior to write:

  1. If the table is keyed it is unkeyed
  2. Are all columns writeable in CSV format. If not, UnsupportedColumnTypeException is thrown.
Clone this wiki locally