#Stations_id von_datum bis_datum Stationshoehe geoBreite geoLaenge Stationsname Bundesland
#----------- --------- --------- ------------- --------- --------- ----------------------------------------- ----------
#00125 20130228 20231128            742     47.8342   10.8667 Altenstadt                                                                       Bayern                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
#02290 20080402 20231127            977     47.8009   11.0108 Hohenpeißenberg                                                                  Bayern                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
#02773 19960501 20231128            415     49.4283   11.9016 Kümmersbruck                                                                     Bayern                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
#03715 19900101 20231128            484     48.2446   11.5525 Oberschleißheim (Lustheim)                                                       Bayern                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
#04928 19900610 20231128            314     48.8281    9.2000 Stuttgart (Schnarrenberg)                                                        Baden-Württemberg                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

STATS="00125 02290 02773 03715 04928"
URL="https://opendata.dwd.de/climate_environment/CDC/observations_germany/radiosondes/high_resolution/recent/"

for STAT in $STATS ; do

ZIP="sekundenwerte_aero_${STAT}_akt.zip"
FILE="sekundenwerte_aero_${STAT}_akt.txt"

echo "${URL}${ZIP}"

#curl -o "${ZIP}" "${URL}${ZIP}"
curl -o "${ZIP}" -z "${ZIP}" "${URL}${ZIP}"

unzip -f "${ZIP}"

TIME=`tail -n 1 ${FILE} | sed 's|;| |g' | awk '{print $2}'`
echo TIME = $TIME


exit 0

done
