[{"data":1,"prerenderedAt":133},["ShallowReactive",2],{"blog-post-jq-convert-json-to-csv":3,"recent-posts":70},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":16},"awgjExIAACgAhicD","jq-convert-json-to-csv",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=axNCmBMAACwA2vJJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awgjExIAACgAhicD%22%29+%5D%5D",[],"2026-12-04T22:45:44+0000",[12],"jq-how-to-convert-json-to-csv",[],"en-us",[],{"title":17,"date":23,"description":24,"image":29,"content":39},[18],{"type":19,"text":20,"spans":21,"direction":22},"heading1","jq: How to Convert JSON to CSV",[],"ltr","2026-12-04",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to convert a JSON array to a CSV file with jq",[],{"dimensions":30,"alt":20,"copyright":6,"url":33,"id":34,"edit":35},{"width":31,"height":32},1280,720,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FTmgVx059WErr3vc3_jq-convert-json-to-csv.png?auto=format,compress","TmgVx059WErr3vc3",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,51,54,57,60,63,67],{"type":41,"text":42,"spans":43,"direction":22},"paragraph","Before we start, make sure you have jq installed on your computer. On a Mac, you can install it with Homebrew:",[],{"type":45,"text":46,"spans":47,"direction":22},"preformatted","brew install jq",[],{"type":41,"text":49,"spans":50,"direction":22},"First, open your terminal and navigate to the folder with your JSON file. It should hold an array of objects. To pick the columns yourself, with a header row, run:",[],{"type":45,"text":52,"spans":53,"direction":22},"jq -r '[\"ID\", \"Name\", \"Email\"], (.[] | [.id, .name, .email]) | @csv' input.json > output.csv",[],{"type":41,"text":55,"spans":56,"direction":22},"The first array is the header. \u003Ccode>.[]\u003C\u002Fcode> loops over each object and builds one row from the fields you list, and \u003Ccode>@csv\u003C\u002Fcode> adds the quotes and escaping. Just replace \u003Ccode>id\u003C\u002Fcode>, \u003Ccode>name\u003C\u002Fcode> and \u003Ccode>email\u003C\u002Fcode> with your own keys.",[],{"type":41,"text":58,"spans":59,"direction":22},"Don't skip \u003Ccode>-r\u003C\u002Fcode>. Without it, jq wraps every row in an extra pair of quotes. A missing value becomes an empty cell, and you can open \u003Ccode>output.csv\u003C\u002Fcode> in Numbers or Excel to check it.",[],{"type":41,"text":61,"spans":62,"direction":22},"If every object has exactly the same keys, you can take the header from the first one: \u003Ccode>(.[0] | keys_unsorted), (.[] | [.[]])\u003C\u002Fcode>. Be careful, though: if one object is missing a key, its values slide into the wrong columns.",[],{"type":64,"oembed":65},"embed",{"embed_url":66,"type":64},"",{"type":41,"text":68,"spans":69,"direction":22},"For objects with different keys, collect every key first: \u003Ccode>(map(keys) | add | unique) as $cols\u003C\u002Fcode>, then look each one up per row. The full command is in the video description.",[],{"results":71,"page":37,"results_per_page":131,"results_size":131,"total_results_size":132,"total_pages":37},[72,92,111],{"id":73,"uid":74,"url":6,"type":7,"href":75,"tags":76,"first_publication_date":10,"last_publication_date":10,"slugs":77,"linked_documents":79,"lang":14,"alternate_languages":80,"data":81},"awgi0RIAACYAhiZv","ripgrep-replace-text-in-files","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=axNCmBMAACwA2vJJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awgi0RIAACYAhiZv%22%29+%5D%5D",[],[78],"how-to-replace-text-in-files-with-ripgrep-and-sed",[],[],{"image":82,"title":88},{"dimensions":83,"alt":84,"copyright":6,"url":85,"id":86,"edit":87},{"width":31,"height":32},"Ripgrep: How to Replace Text in Files with Ripgrep and Sed","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FOlJ7le5oNEXxcE_I_ripgrep-replace-text-in-files.png?auto=format,compress","OlJ7le5oNEXxcE_I",{"x":36,"y":36,"zoom":37,"background":38},[89],{"type":19,"text":90,"spans":91,"direction":22},"How to Replace Text in Files with Ripgrep and Sed",[],{"id":93,"uid":94,"url":6,"type":7,"href":95,"tags":96,"first_publication_date":10,"last_publication_date":10,"slugs":97,"linked_documents":99,"lang":14,"alternate_languages":100,"data":101},"awgi2hIAACoAhiaF","ripgrep-case-insensitive-search","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=axNCmBMAACwA2vJJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awgi2hIAACoAhiaF%22%29+%5D%5D",[],[98],"ripgrep-how-to-search-case-insensitive",[],[],{"image":102,"title":108},{"dimensions":103,"alt":104,"copyright":6,"url":105,"id":106,"edit":107},{"width":31,"height":32},"Ripgrep: How to Search Case Insensitive","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F6H2DfjROfkSO4wel_ripgrep-case-insensitive-search.png?auto=format,compress","6H2DfjROfkSO4wel",{"x":36,"y":36,"zoom":37,"background":38},[109],{"type":19,"text":104,"spans":110,"direction":22},[],{"id":112,"uid":113,"url":6,"type":7,"href":114,"tags":115,"first_publication_date":10,"last_publication_date":10,"slugs":116,"linked_documents":118,"lang":14,"alternate_languages":119,"data":120},"awgi_hIAACoAhibc","jq-use-with-curl","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=axNCmBMAACwA2vJJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awgi_hIAACoAhibc%22%29+%5D%5D",[],[117],"how-to-use-jq-with-curl",[],[],{"image":121,"title":127},{"dimensions":122,"alt":123,"copyright":6,"url":124,"id":125,"edit":126},{"width":31,"height":32},"jq: How to Use jq with curl","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F3JyqU0cTsv3S-6D0_jq-use-with-curl.png?auto=format,compress","3JyqU0cTsv3S-6D0",{"x":36,"y":36,"zoom":37,"background":38},[128],{"type":19,"text":129,"spans":130,"direction":22},"How to Use 'jq' with 'curl'",[],3,137,1796424369462]