Skip to content

Instantly share code, notes, and snippets.

@meau
Created September 26, 2017 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meau/cd15fcaf1371e8f0488308ad92017fa6 to your computer and use it in GitHub Desktop.
Save meau/cd15fcaf1371e8f0488308ad92017fa6 to your computer and use it in GitHub Desktop.
import shutil, os
with open('files.txt', 'r') as images:
myImages = {line.strip() for line in images}
print myImages
dir_src = r"/Volumes/nas/SSC-CAImages/ArchivalTIFF"
dir_dst = r"/Users/mcallahan/Desktop/PPImages"
for dirpath, dirs, files in os.walk(dir_src):
for file in files:
bn,ext = os.path.splitext(file)
if ext == ".tif" and any(s in file for s in myImages):
shutil.copy( os.path.join(dirpath, file), dir_dst )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment