Skip to content

Instantly share code, notes, and snippets.

@anujbhatt
Created March 11, 2015 15:30
Show Gist options
  • Save anujbhatt/66d8333e10052369f9f8 to your computer and use it in GitHub Desktop.
Save anujbhatt/66d8333e10052369f9f8 to your computer and use it in GitHub Desktop.
Convert a set of .log.[0-9]* log4j/log4net files to txt so it's easier to open them on a Mac
#!/usr/bin/python
if __name__ == '__main__':
import os
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
if ".log" in f:
print "renaming %s" % (f)
os.rename(f, f+".txt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment