4 CSV_URL=https://www.berlin.de/lageso/_assets/gesundheit/publikationen/corona/bezirkstabelle.csv
5 table_path=/home/plom/berlin-corona-table/daily_infections_table.txt
7 # If we don't have a table file yet, we need to provide its header.
8 header=" CW FK Li MH Mi Ne Pa Re Sp SZ TS TK sum"
9 if [ ! -f "${table_path}" ]; then
10 echo "${header}" > "${table_path}"
13 # Parse Lageso day table of new infections by district into new line for history table.
14 today="$(date +%Y-%m-%d)"
16 | awk 'BEGIN { FS=";"; ORS=""; print "'${today}'" }; '\
17 '!/^Bezirk/ { printf "%4d", $3 }; '\
18 'END { printf "\n" }' "${filename}" >> "${table_path}"
20 # Write enhanced table output to directory served by web server.
21 ./enhance_table.py "${table_path}" > /var/www/html/berlin_corona.txt