Fix ragged lines support for fixed files, fixing #90.

It's possible for the data to stop before the end of a specified column,
in which case we still want to accept whatever shortened data we have.
This commit is contained in:
Dimitri Fontaine 2014-06-24 18:58:26 +02:00
parent f7d251ed86
commit d1100efa28

View File

@ -38,8 +38,8 @@
:for opts :in fixed-cols-specs
:collect (destructuring-bind (&key start length &allow-other-keys) opts
(let ((end (+ start length)))
(when (<= end len)
(subseq line start end))))))
(when (<= start len)
(subseq line start (min len end)))))))
(defmethod map-rows ((fixed copy-fixed) &key process-row-fn)
"Load data from a text file in Fixed Columns format.