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
- Host: GitHub
- URL: https://github.com/mrc/el-csv
- Owner: mrc
- Created: 2011-05-04T22:40:27.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2024-12-14T02:46:45.000Z (over 1 year ago)
- Last Synced: 2025-02-12T01:17:49.025Z (over 1 year ago)
- Language: Emacs Lisp
- Homepage:
- Size: 13.7 KB
- Stars: 13
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
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