Display full version of the post: Simple Lisp Problem?

jpkibble
29.11.2010, 16:58
Hi,The lisp below works great for extracting a list of comma separated values from a csv file. In this case two columns with x coordinates in one and y coords in another. However when I try and use car and cadr to extract the first column value from the second CAD returns an error.I'm sure this one's about the data type not being a list.Can anyone help?(defun c:csv ()(setq selfile (getfiled "Select File" "" "csv" 0))(setq openfile (open selfile "r"))(while (setq line (read-line openfile))(defun c:csv ()(setq selfile (getfiled "Select File" "" "csv" 0))(setq openfile (open selfile "r"))(while (setq line (read-line openfile))(setq linex (car line))(setq liney (cadr line))(princ "\n")(princ line)(princ "\n")(princ linex)(princ "\n")(princ liney)))