Skip to content

Instantly share code, notes, and snippets.

@yangsu
Created May 10, 2020 19:19
Show Gist options
  • Save yangsu/9a8844684d56fade659602dd48911b7f to your computer and use it in GitHub Desktop.
Save yangsu/9a8844684d56fade659602dd48911b7f to your computer and use it in GitHub Desktop.
jq -r 'group_by(.artistName) | map({msPlayed: map(.msPlayed) | add | (. / 1000 / 3600 * 100) | round | (./100), artistName: .[0].artistName}) | sort_by(-.msPlayed) | .[] | [.msPlayed, .artistName] | @csv' < StreamingHistory0.json | sort -nr > artist_by_ms_played.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment