Created
July 8, 2012 13:14
-
-
Save 013231/3070895 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
#!/usr/bin/env python | |
import os | |
import shutil | |
count = 0 | |
for filename in os.listdir('.'): | |
if filename.endswith('.txt') and os.path.isfile(filename): | |
destDir = 'AAA%d' % (count / 500 + 1) | |
if count % 500 == 0: | |
os.mkdir(destDir) | |
shutil.move(filename, destDir) | |
count += 1 | |
if count % 1000 == 0: | |
print '%d files have been moved.' % count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment