Last active
August 4, 2016 09:04
-
-
Save kieranjol/cd40f53b743c7afbf309d85db68d594f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| from glob import glob | |
| input = sys.argv[1] | |
| os.chdir(input) | |
| tiffs = glob('*.tiff') | |
| for i in tiffs: | |
| filename = i | |
| # create new variable which trims the first 18 characters. | |
| filename_fix = filename[18:] | |
| print filename_fix | |
| fix_with = 'ab595_ifard2016104' | |
| new_filename = fix_with + filename_fix | |
| print new_filename | |
| os.rename(filename, new_filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment