Created
December 11, 2015 22:50
-
-
Save tlrobinson/b7bcb9fd4b8d736ad76b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -O https://raw.githubusercontent.com/hackclub/metrics/master/slack_stats.tsv | |
awk 'NR==1 { for (i=2;i<=NF;i++) x[i] = $i } NR!=1 {for (i=2;i<=NF;i++) print $1"\t"x[i]"\t"$i}' slack_stats.tsv > slack_stats_unpivoted.tsv | |
sqlite3 slack_stats.sqlite3 <<EOF | |
create table slack_stats (user text, date text, count int); | |
.separator "\t" | |
.import slack_stats_unpivoted.tsv slack_stats | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment