mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
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:
parent
f7d251ed86
commit
d1100efa28
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user