Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] - line number #692

Open
1 of 2 tasks
sosoba opened this issue Jul 7, 2021 · 0 comments
Open
1 of 2 tasks

[FEATURE] - line number #692

sosoba opened this issue Jul 7, 2021 · 0 comments
Assignees

Comments

@sosoba
Copy link

sosoba commented Jul 7, 2021

Parsing or Formatting?

  • Formatting
  • Parsing

Is your feature request related to a problem? Please describe.
Ffor better UI i want to bind parsed data with csv file line numbers . For example to give message like:
Import error. Csv line 134 803. Value of field [Product ] is missing from the database. Do you want to add it?

Because of headers, ignored and comment lines there is no simple rule between parsed data row index and csv line.

Describe the solution you'd like

const csv = parse( stream, {
   addLineNumber: true,
});
csv.on('data', row => console.log(row.lineNumber));

where new parameter:

addLineNumber?: boolean | string | Symbol; // default property name is `lineNumber`

enabling new feature (true) and optionaly allow change property name for row counter (string | Symbol)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants