Category : jq

Be informed, we are trying to convert .geojson (openstreetmaps) to csv using ‘jq’ command in command line prompt. On running the following command: jq -r ‘(.features[0] | keys_unsorted), (.users[] | to_entries | map(.value))|@csv’ temp.json It throws up this error jq: error (at gcc.geojson:1892525): Cannot iterate over string ("Feature"). The gcc.geojson file contains 189252 lines. Sample ..

Read more

Json file sample (test1.json) : { "entries": [ { "duration": 478, "id": "uCPPyitzI", "title": "Why | TV", "description": null, "uploader": null, "view_count": null, "ie_key": "Youtube", "url": "uCPPyitzI", "_type": "url_transparent" }, { "duration": 245, "id": "F9ClW8Dv0", "title": "Kejrixxxx | TV", "description": null, "uploader": null, "view_count": null, "ie_key": "Youtube", "url": "F9ClW8Dv0", "_type": "url_transparent" }, { "duration": 990, ..

Read more

How to concatenate an array in json using JQ trying to combine the rows. Here is the source { “movie_results”: [ { “genre_ids”: [ 28, 35, 80 ], “id”: 96, } ] Here is my command line C:WINDOWSsystem32>curl “https://api.themoviedb.org/3/find/tt0092644?&external_source=imdb_id” | jq -r “.movie_results[] | .id, (.genre_ids | join(“,”)) Im getting the following result 96 28,35,80 ..

Read more