screenshot of a google sheet csv file import

JSON to CSV

For a report I needed to retrieve all the issues I commented on from GitHub, and then I needed it in a comma-delimited format.

The parts:

A quick and dirty way for one time use:

The steps

Use the gh command

Find 50 issues I commented on in the Gutenberg Repo sorted by creation date, in json format, show the fields “url” and “title”. Copy in the terminal window in VS Code.

gh search issues --commenter bph --repo 'WordPress/gutenberg' --sort 'created' --limit 50 --json 'url','title'

Copy JSON output

I copied the console output into a new file issues.json and saved it as “issues.json”

Use convert JSON to CSV

Then I used from the Command palette (F1 by default) the command “Convert JSON to CSV”. Saved as a new file: “issues.csv”

Import to Google Sheet

Lastly I imported the issues.csv file into a new Google Sheet.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.