Last active
April 19, 2021 06:41
-
-
Save AndiH/8d2233c6a3e4bb546bdeebe0dff005cb to your computer and use it in GitHub Desktop.
Impf Extraction
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
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
Kreis | Erstimpfung | Folgeimpfung | Erstimpfung | Folgeimpfung | Erstimpfung | Folgeimpfung | Summe | |
---|---|---|---|---|---|---|---|---|
Aachen | 93.368 | 34.456 | 13.845 | 39 | 107.213 | 34.495 | 141.708 |
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
#!/usr/bin/env bash | |
URL="https://coronaimpfung.nrw/fileadmin/ci_dateien/pdf/Durchgef%C3%BChrte_Impfungen_je_Kreis.pdf" | |
DATE=$(date +"%Y-%m-%d") | |
curl -o "${DATE}.pdf" ${URL} | |
echo "Written ${DATE}.pdf" |
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
#!/usr/bin/env bash | |
INPUT="$1" | |
OUTPUT="${INPUT%.*}.csv" | |
pdftotext -layout ${INPUT} - | grep -e 'Erstimpfung\|Aachen' | tr -s " " "," | sed 's/,Erstimpfung/Kreis,Erstimpfung/' > ${OUTPUT} |
Ah, sehr gut. Für diese Datums-Regex war ich zu faul 😬
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Und hier wird es noch in ein CSV geschrieben. Die Kopfzeile muss man dann natürlich manuell einbauen, empfiehlt sich aber ja eh, da Feldnamen sich sonst doppeln.