Created
October 8, 2014 14:35
-
-
Save random-robbie/4cec8056815362550726 to your computer and use it in GitHub Desktop.
Scan all folders and sub-directories and print to output file.
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, time, glob, fnmatch | |
maindir = "THE FOLDER YOU WISH TO SCAN" | |
def scanfolder(): | |
os.chdir(maindir) | |
for name in glob.glob('*/*.pdf'): | |
fo = open("Output.txt", "wb") | |
print name | |
fo.write(name + "\n") | |
fo.close() | |
print "Now scanning for text files" | |
scanfolder() | |
time.sleep(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment