danmandle/JSON2CSV

json2csv

sonomilko opened this issue · 4 comments

hello world :)
i need to convert json google stream data to csv (or xml). here a sample of data:
https://docs.google.com/spreadsheets/d/16TlohLsP0kv-cfoxnDO128ZcS_67rzObzAY4F6gorwg/gviz/tq

at the moment i'm able to create a script which download data to my pc, remove non-json info from header&footer of the stream and convert-it to csv, but the conversion isn't really orthodox :-) (the conversion need all the fields must be populated, not "null" value).
i've noticed that exist a json2csv php script but really don't know how to use it.
i've tryed to run the php script putting the json2csv.php inside www folder of my wamp installation: don't run.

could you show me a solution ?
thx

This json is not flat.

how to save csv file in my current directory where i m having this script

I tried to run the php files and convert my json files, the .csv i get is different and I did not make any changes to your code, but result seems different compared to the application in your blog at http://www.danmandle.com/blog/json-to-csv-conversion-utility/. Same Json file conducted the test, but the result it different.

I got this from the php files during testing:
image

I got this from your blog application:
image

I am still a beginner in php, hopefully i can get some guidance.

@felixyong92 Looks like instead of using commas, your CSV is outputting semicolons.