node-csv icon indicating copy to clipboard operation
node-csv copied to clipboard

a solution to repair rows when using columns

Open dsl400 opened this issue 2 years ago • 1 comments

Summary

It would be useful to have a method to repair rows when using columns.

Motivation

In my case some rows have one or two columns more than the rest and I can repair the row by shifting the content two cells to the left at a specific point. However, when using columns, the record argument passed to on_record does not contain the values defined outside of the columns range.

Draft

A simple solution is providing access to the original row data as array in the context argument of on_record.

Having access to columns definitions and original row data inside on_record will enable the programmer to rebuild the record

dsl400 avatar Nov 03 '23 20:11 dsl400

Would using on_record with raw: true solve your demand? See the "properties with columns: true and raw: true" test.

wdavidw avatar Nov 06 '23 08:11 wdavidw