CSV Parser for Common Lisp
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE.txt
README.md
csv.asd
csv.lisp

README.md

CSV Parser for Common Lisp

The csv package is a dead-simple Comma Separated Values parser for Common Lisp. It adhears to the RFC 4180 spec.

Quickstart

Parsing a CSV is simply a matter of calling parse-csv.

(parse-csv string &optional source) ;=> list

It is always assumes that the CSV is multi-line, so the result is a list of lists, where each inner list is a record of cells.

CL-USER > (parse-csv "1,2,3")
(("1" "2" "3"))

Generating a CSV string from Lisp is done with the format-csv function.

(format-csv record &optional stream) ;=> string

The record parameter should be a list of cells and not a list of records.

CL-USER > (format-csv '(1 "Hello, world" 2))
"1,\"Hello, world\",2"

That's it!