AccelerationNet / cl-csv

A common lisp library providing easy csv reading and writing
Other
116 stars 22 forks source link

Can't skip header and utilize map-fn #48

Open ctyler9 opened 4 months ago

ctyler9 commented 4 months ago
(defun load-event-data (data-path)
  (let ((data (cl-csv:read-csv data-path 
                               :skip-first-p t
                               :map-fn (lambda (row)
                                         (make-instance 'PRC
                                                        :security "ADA"
                                                        :timestamp (nth 2 row)
                                                        :price (nth 3 row)
                                                        :lastvolume (nth 7 row))))))
    (format t "Total objects created: ~A~%" (length data))
    data))

there seems to be a bug when trying to create objects through :map-fn... the header/first row isn't skipped.