I want to convert some 20mb+ JSON files to CSV.
So how can I use other tools to do such conversions?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
jq works quite well for this, you can install it via Homebrew. Specific usage depends on the structure of your JSON file, the accepted answer on https://unix.stackexchange.com/questions/570548/convert-json-array-into-csv has details which should help to get started.
Search engines are great for identifying options for something like this. For example, if you want to do this in Python, this search may help. A more language-neutral search may be to search github for JSON to CSV converters.
I tend to do these things from the command line, or in small scripts. I've tried
jq and I've tried
jq has a larger following, but I have a preference for
Miller because I get results I need without too much effort... but YMMV. One other thing: If you decide to try
Miller you should file this link to the "Cookbook" page for
Miller... it's not advertised well, but I find it useful 'cause I'm a cook :)