Skip to content

Instantly share code, notes, and snippets.

@snodnipper
Created December 4, 2014 16:58
Show Gist options
  • Save snodnipper/d757eb1ce9f44a53c86a to your computer and use it in GitHub Desktop.
Save snodnipper/d757eb1ce9f44a53c86a to your computer and use it in GitHub Desktop.
Terrain 50 sanitiser
import os, os.path, re
for root, _, files in os.walk("./"):
for f in files:
fullpath = os.path.join(root, f)
replaced = re.sub("_OST50GRID\w*", "", f)
newfullpath = os.path.join(root, replaced)
print fullpath
print newfullpath
os.rename(fullpath, newfullpath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment