Closed vamshing closed 6 years ago
Please provide the full error trace, the portion you provided is very specific to your data (which looks to be a rather large data set).
It looks like you are trying to parse a JSON file with multiple separate JSON root objects (which isn't part of the default spec) you might try the --each-line
command since it's not standard JSON.
Traceback (most recent call last):
File "json2csv.py", line 148, in
I tried the --each-line command for the outline file generation.....it worked fine... but when I tried to convert the json to csv using the outline file........the above error was thrown out/...
Thank for helping in advance..
Did you run json2csv with --each-line
as well? Mongo data is pretty much the only file format that put multiple JSON root elements into a single file so it's a special case, not assumed.
did that....--each-line
Waynes-MacBook-Pro:json2csv vamshiguduguntla$ python json2csv.py /Users/vamshiguduguntla/Documents/04_08_CleanAppData/PlayStore_2015_05.json /Users/vamshiguduguntla/Documents/04_08_CleanAppData/PlayStore_2015_05.outline.json -o /Users/vamshiguduguntla/Documents/04_08_CleanAppData/PlayStore_2015_05.outline.csv --each-line Killed: 9
process took long but it says killed...
Oh, that's a good observation. I created this with the most naive implementation which means it loads all the data into memory before writing it to a file.
I suspect it would suit your purpose if the writing was buffered and periodically written to file so it doesn't require as much memory. I've created a feature branch 13-direct-transcription
that has an experiment that will write out to the CSV file instead of to a memory collection. This should avoid getting the process killed due to memory consumption.
Let me know how it works out and I can add more tests and such around it
This commit branch worked!
Thank you very much...
Now that I have to deal with a 12.2 GB csv file...
Thanks a lot
How to execute this ?
$ python /home/user1/work/json2csv.py /home/user1/work/data.json usage: json2csv.py [-h] [-e] [-o OUTPUT_CSV] [--strings] json_file key_map json2csv.py: error: too few arguments
Please read the instructions in the README. You need a key-map file to instruct json2csv what data to extract.
Closing this thread because it's resolved
When I try to outline the json file,
I get the above error.
Please help