Skip to content

Instantly share code, notes, and snippets.

@nikmolnar
Created June 4, 2016 00:43
Show Gist options
  • Save nikmolnar/239ccc7bbb6c00d14925d55996ec021b to your computer and use it in GitHub Desktop.
Save nikmolnar/239ccc7bbb6c00d14925d55996ec021b to your computer and use it in GitHub Desktop.
Bash script to convert all GeoTIFF files in a directory to NetCDF
#!/bin/bash
for filename in ./*.tif; do
if [[ $filename =~ Y_([a-zA-Z0-9_]+)\.tif$ ]]
then
variable="${BASH_REMATCH[1]}"
clover to_netcdf $filename netcdf/$variable.nc $variable
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment