Skip to content

Instantly share code, notes, and snippets.

@miminashi
Last active August 1, 2020 21:29
Show Gist options
  • Save miminashi/a57f8bc2828364dbc8ccc4ee58d5d838 to your computer and use it in GitHub Desktop.
Save miminashi/a57f8bc2828364dbc8ccc4ee58d5d838 to your computer and use it in GitHub Desktop.
# 表
curl -s "https://www.e-stat.go.jp/stat-search/file-download?statInfId=000031881367&fileKind=1" | iconv -f sjis -t utf8 | tail -n +39 | cut -d ',' -f 1-3 | tr ',' ' ' | awk '{print($1, $2, $3, $3*100/$2)}' | awk 'BEGIN{print("年次", "届出総数", "〜19歳", "割合(%)")} {print $0}' | column -t -s ' '
# グラフ
curl -s "https://www.e-stat.go.jp/stat-search/file-download?statInfId=000031881367&fileKind=1" | iconv -f sjis -t utf8 | tail -n +39 | cut -d ',' -f 1-3 | tr ',' ' ' | awk '{print($1, $2, $3, $3*100/$2)}' | feedgnuplot --domain --lines --points --title "marriage" --y2 2 --unset grid --terminal 'dumb 120,50' --exit --legend 0 "number, total" --legend 1 "number, women under 19" --legend 2 "percent, women under 19"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment