An open API service indexing awesome lists of open source software.

https://github.com/mrc/el-csv

Parse CSV data in elisp
https://github.com/mrc/el-csv

Last synced: over 1 year ago
JSON representation

Parse CSV data in elisp

Awesome Lists containing this project

README

          

* 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

#+BEGIN_SRC elisp
(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"))
#+END_SRC