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

Paginated conversion ? #234

Open
4 of 5 tasks
salimdriai opened this issue Jul 23, 2023 · 1 comment
Open
4 of 5 tasks

Paginated conversion ? #234

salimdriai opened this issue Jul 23, 2023 · 1 comment

Comments

@salimdriai
Copy link

Background Information

  • Module Version: 4.0.0
  • Node/Browser Version: 18

The issue I'm reporting is with:

  • json2csv
  • csv2json

I have...

  • searched to see if an issue has already been reported.
  • verified that my JSON/CSV data is valid (using something like http://jsonlint.com or https://csvlint.io/).
  • tried upgrading to the latest version of json-2-csv (since the issue may already be fixed).

Expected Behavior

Convert specific number of lines, and ability to select a range something like paginated conversion .

Actual Behavior

There is no way to achieve that i think ?

Data Sample

CSV:

h1, h2, h3
c1, c2, c3,
b1, b2, b3,
f1, f2, f3,
d1, d2, d3,

convert only second line

JSON:

{
"h1": "b1",
"h2": "b2",
"h3" : "b3",
}
@mrodrig
Copy link
Owner

mrodrig commented Aug 3, 2023

Hi @salimdriai, thanks for reporting this. You're right - there's currently no way to effectively paginate the returned CSV at the moment. I could definitely see a skip and limit option being reasonable additions. There might be some rework needed to handle this more efficiently in the CSV parser itself though. I'm definitely open to a merge request for this if you or someone else is up for adding this capability.

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

2 participants