Created
February 4, 2018 02:04
-
-
Save infontology/b91abc04b82849f8434513f0f98768b6 to your computer and use it in GitHub Desktop.
This file contains 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 shutil | |
raw_ext = '.NEF' | |
jpg_ext = '.JPG' | |
destination = 'raws' | |
for filename in os.listdir('.'): | |
(shortname, extension) = os.path.splitext(filename) | |
if extension == raw_ext: | |
if os.path.isfile(shortname + jpg_ext) == False: | |
print 'Moving ' + shortname + raw_ext + '...' | |
shutil.move(shortname + raw_ext, destination) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Modifierat från ttaveiras script här https://photo.stackexchange.com/questions/16401/how-to-delete-jpg-files-but-only-if-the-matching-raw-file-exists
Obs att mitt syfte är att ta bort raw-filer om inte jpg-filen finns, och inte tvärtom...