Created
April 30, 2013 09:49
-
-
Save syohex/5487731 to your computer and use it in GitHub Desktop.
very simple csv parser in emacs lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'cl) | |
(defun parse-csv-file (file) | |
(interactive | |
(list (read-file-name "CSV file: "))) | |
(let ((buf (find-file-noselect file)) | |
(result nil)) | |
(with-current-buffer buf | |
(goto-char (point-min)) | |
(while (not (eobp)) | |
(let ((line (buffer-substring-no-properties | |
(line-beginning-position) (line-end-position)))) | |
(push (split-string line ",") result)) | |
(forward-line 1))) | |
(reverse result))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment