Skip to content

Instantly share code, notes, and snippets.

@blech
Last active December 20, 2015 07:59
Show Gist options
  • Save blech/6097006 to your computer and use it in GitHub Desktop.
Save blech/6097006 to your computer and use it in GitHub Desktop.
Extract an station's history from GSOD
#!/bin/bash
# TODO the station code should be an argument
# also I just ran this as one line so it might not even work as a script
# GSOD: http://www.ncdc.noaa.gov/cgi-bin/res40.pl?page=gsod.html
for i in gsod_199*.tar;
do y=`echo $i | awk -F '_' '{print $2}' | awk -F '.' '{print $1}'`;
echo working on $i $y;
tar -xvf $i 037720-99999-$y.op.gz;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment