mafintosh / mafintosh/csv-parser

[Feature request] Skip lines until certain text appears

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

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.5k
Forks
143
PR merge metrics
No merged PRs in 30d

Description

### Feature Proposal

It would be nice to have an option that skips lines until a certain text appears (in the simplest way at the beginning of the line, or more versatile with a regex). The fixed number for skip lines is too rigid for an application I have. The numeric `skipLines` option should still be there, after which the, let's call it, `skipUntil` option checks the lines for a text match. A match would be the first line of the import.

### Feature Use Case

I have a CSV file that comes from a banking application. That file contains a few lines with miscellaneous information at the beginning. The problem is that the number of lines is different depending on export settings. The actual CSV-data start at line 7, 8 or 9 with the column headers. The column headers are always the same, which I could match for to mark the start of the data.

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

Start by locating the parser's existing numeric skipLines option and its tests or usage examples. Add a skipUntil option that matches the beginning of a line or a regex after skipLines, and verify that the first matching line becomes the CSV header and import start.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-engineering
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.