Created
October 15, 2014 01:02
-
-
Save dezgeg/c07764e189180b215832 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
cd "$(dirname "$0")" | |
if ! [ -f csv.zip ]; then | |
echo "Downloading data." >&2 | |
wget http://pilvilinna.cert.fi/opendata/autoreporter/csv.zip | |
fi | |
echo "Incident category frequencies:" | |
unzip -c csv.zip 2>/dev/null | grep -v '^#' | cut -d'|' -f6 | sort | uniq -c | perl -pe 's/^ *(\d+) (.*)$/$2 $1/' | |
echo "Location frequencies:" | |
unzip -c csv.zip 2>/dev/null | grep -v '^#' | cut -d'|' -f8-9 | sort | uniq -c | perl -pe 's/^ *(\d+) (.*)$/$2 $1/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment