Parse CSV data in elisp
Emacs Lisp
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.org
parse-csv.el
test-parse-csv.el

README.org

parse-csv

Parse strings with CSV fields into s-expressions

This file implements `parse-csv->list’, `parse-csv-string’, and `parse-csv-string-rows’.

parse-csv-string is ported from Edward Marco Baringer’s csv.lisp: http://common-lisp.net/project/bese/repos/arnesi_dev/src/csv.lisp

It was ported to Emacs Lisp by Matt Curtis.

Examples

(parse-csv->list "a,b,\"c,d\"")
    => ("a" "b" "c,d")

(parse-csv-string "a;b;'c;d'" ?\; ?\')
    => ("a" "b" "c;d")

(parse-csv-string-rows "a,b,c,do\"\ng\"\ne,f,g,h" ?\, ?\" "\n")
    => (("a" "b" "c" "do\ng") ("e" "f" "g" "h"))

(parse-csv-string-rows "a,b,c,do\"\ng\"\n\ne,f,g,h" ?\, ?\" "\n")
    => (("a" "b" "c" "do\ng") ("") ("e" "f" "g" "h"))