This is quick and dirty, no testing, no error checking:
Code:
(defun ReadCSVFile(FileName / rtlist)
(setq fileh (open FileName "r"))
(while (setq line (read-line fileh))
(setq rtlist (cons (str2list line ",") rtlist))
)
(reverse rtlist)
)
;;;By John Uhden, as posted to the autodesk customization newsgroup 06 Feb 2003
(defun Str2List (str pat / i j n lst)
(cond
((/= (type str)(type pat) 'STR))
((= str pat)'(""))
(T
(setq i 0 n (strlen pat))
(while (setq j (vl-string-search pat str i))
(setq lst (cons (substr str (1+ i)(- j i)) lst)
i (+ j n)
)
)
(reverse (cons (substr str (1+ i)) lst))
)
)
)
Note: This fails on values with a quoted comma
Here is a thread on TheSwamp.org with code to deal with quoted commas: http://www.theswamp.org/index.php?topic=19527.0