#!/bin/bash # retrieve URL url="https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile" wget -o /dev/null $url -O out.xlsx # convert to csv # run 'pip3 install xlsx2csv' (or maybe pip depending on your python installation) xlsx2csv -a out.xlsx out.csv # figure out the number of days we got vaccination data # exclude those with no vaccination happening days=$(grep -c '^[01][0-9].*,[1-9]\d*,\d*,\d*' out.csv/Impfungen_proTag.csv) # extract the total number of vaccinations total_first_vaccinations=$(grep ^Gesamt, out.csv/Impfungen_proTag.csv| cut -d',' -f2) # average vaccinations per day so far, multiply with 1.0 to get floats average_vaccinations_per_day=$(echo "scale=2;$total_first_vaccinations/$days" | bc -l) # figure out how many days we need to wait for everyone to be vaccinated population=83000000 days=$(echo "scale=0;$population/$average_vaccinations_per_day" | bc) years=$(echo "scale=2;$days/365.0" | bc) RED='\033[0;31m' NC='\033[0m' echo -e "Days until full vaccination: ${RED}$days${NC} (aka ${RED}$years${NC} years)"