Skip to content

Instantly share code, notes, and snippets.

@danamlewis
Last active February 13, 2017 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danamlewis/aab795a7ec0bdd3abbb08b1f9be79663 to your computer and use it in GitHub Desktop.
Save danamlewis/aab795a7ec0bdd3abbb08b1f9be79663 to your computer and use it in GitHub Desktop.
Unzipping json files from OpenHumans, renaming, and porting over to CSV

If you are running on Nightscout-related data and keep the first for loop, it uses jsonV as a simplistic way to grab ONLY BG and time stamp for the entries.csv creation. If you keep that for loop, you must:

  1. Install jsonV (https://github.com/archan937/jsonv.sh)
  2. Install gawk (http://macappstore.org/gawk/)
  3. (For Mac OS X, I think I also had to install coreutils gnu-sed, and brew install homebrew/dupes/gzip)
  4. Update script:
  • figure out how you want to name/rename
  • figure out the format of your json, and what datums you want to put into csv
  1. Make sure to chmod+x filename the file

Other General Tips:

  • Depending on size of data files, create a test folder with ONE folder/file to make sure script works w/ your edits before running through large folder/file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment