mrodrig / json-2-csv

Convert JSON to CSV *or* CSV to JSON!
https://mrodrig.github.io/json-2-csv
MIT License
420 stars 58 forks source link

Paginated conversion ? #234

Open salimdriai opened 1 year ago

salimdriai commented 1 year ago

Background Information

The issue I'm reporting is with:

I have...

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 commented 1 year ago

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.