adaltas / adaltas/node-csv

a solution to repair rows when using columns

Open
#403 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
4.3k
Forks
299
Avg merge
16h 19m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by tracing the parser's columns option and the on_record callback, focusing on how record and context are assembled. Done should provide a defined way to access original row data and column definitions during on_record so irregular rows can be rebuilt.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.