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

large files not converting #64

Closed
m-prof opened this issue Jan 20, 2020 · 10 comments · Fixed by #70
Closed

large files not converting #64

m-prof opened this issue Jan 20, 2020 · 10 comments · Fixed by #70
Assignees
Labels
bug ready to close Issue reporter will close when satisfied
Milestone

Comments

@m-prof
Copy link

m-prof commented Jan 20, 2020

I have a series of JSON which are only about 100k (or greater) in size. But when I try to convert I get an empty file. Smaller files convert fine.

This is from within a Windows 10 environment.

@akhilchandran
Copy link

I am having same Issue, When using stream, Also found that issue is with

if (self._extra.length > chunk.toString().length * 3) return null;// lib/core/stream.js

It happens for last chunk which happen to be at the smaller than the last stored json part.

@kaue
Copy link
Owner

kaue commented May 23, 2020

@m-prof r you using the stream feature from jsonexport?
@akhilchandran i will try to reproduce this later.

@m-prof
Copy link
Author

m-prof commented May 24, 2020

I am just using the basic command listed on the main page (http://kauegimenes.github.io/jsonexport/),
jsonexport <JSON filename> <CSV filename>.
Gives me an empty file. Is there an option I should be using?

For reference I attach a sample file.
sample.zip

@kaue kaue added this to the 3.0.0 milestone May 24, 2020
@kaue kaue removed the help wanted label May 24, 2020
@kaue kaue self-assigned this May 24, 2020
@kaue
Copy link
Owner

kaue commented May 24, 2020

@m-prof can you try again using the branch bugfix/stream-memory-limit?

@kaue kaue added the ready to close Issue reporter will close when satisfied label May 24, 2020
@kaue kaue linked a pull request May 24, 2020 that will close this issue
@m-prof
Copy link
Author

m-prof commented May 24, 2020

Thanks! But I am still getting an empty file. You can confirm with the sample file I sent.

@kaue
Copy link
Owner

kaue commented May 24, 2020

@m-prof i did test with the sample you provided and got a csv with 322 lines.

try this:

git checkout bugfix/stream-memory-limit
./bin/jsonexport.js sample.json output.csv

@m-prof
Copy link
Author

m-prof commented May 24, 2020

OK good it is something on my end! Are you doing this within Windows 10?

I am not sure how to execute those commands you mentioned within Win 10 (e.g. if try jsonexport.js sample.json output.csv I get a microsoft jscript compilation error

@kaue
Copy link
Owner

kaue commented May 30, 2020

@m-prof can you try using jsonexport@2.5.2? i just published this version to npm, this should fix your issue

@kaue
Copy link
Owner

kaue commented May 30, 2020

@m-prof feel free to reopen this issue if this fix does not work for you.

@kaue kaue closed this as completed May 30, 2020
@m-prof
Copy link
Author

m-prof commented Jun 12, 2020

Thanks so much kaue! This works now for me, for all files I checked. I have a speed question which I I am posting in a new thread: #75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ready to close Issue reporter will close when satisfied
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants