CSV support for Vellum Data Frames
This system adds a basic support for reading tables from and writing tables to csv files.
(defparameter *table* (vellum:copy-from :csv "~/csv.csv" :includes-header-p t :columns '(a b)))
(vellum:copy-to :csv "~/output.csv" *table* )
Strings are automaticly converted to values, depending on the :TYPE of the column. Only numbers and strings are supported at this point though. Additional types can be supported by specializing FROM-STRING and TO-STRING generic functions.
This system is implemented by the means of the CSV-RANGE. CSV-RANGE can be used on it's own to aggregate CSV files that are unsuitable for putting in to the table. Example of these are a very large files, that are unlikely to fit into the main memory. Using reservoir sampling or data sketch techniques (available in CL-DS) can be favored in those situations. Furthermore, instead of passing path to the CSV file, it is actually possible to use this system with an cl-ds range, as long as it yields csv rows in the form of the string. This makes it possible to read mutliple CSV into a singular table at once, use (already mentioned) reservoir sampling techniques or integrate with UNIX system to handle tricky archive formats (XYZ for instance). The downside is that this forces user to remove CSV table headers manually.