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

Assign row number to each record #328

Open
bas080 opened this issue Mar 12, 2022 · 2 comments
Open

Assign row number to each record #328

bas080 opened this issue Mar 12, 2022 · 2 comments

Comments

@bas080
Copy link

bas080 commented Mar 12, 2022

Summary

The idea is to opt into adding a row number and having that value assigned to a configured property.

Motivation

It's handy for me because it allows my user interface to tell the user where that data has come from better.

Alternative

I have considered adding a row number to my CSV raw data before putting it in csv-parse.

Draft

parse({
  row: true, // will result in a row property added to each record
  row: 'some_other_field' // will assign the row number to that field.
})
@bas080
Copy link
Author

bas080 commented Mar 12, 2022 via email

@bas080
Copy link
Author

bas080 commented Mar 12, 2022

I see there is a on_record option. It has lines let me check if it has columns too...

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

1 participant