File names changed to folders??
December 16, 2010 12:34PM
edited January 2014
Does anyone know of an application or utility that will:
- copy a list of file names,
- then output that list of file names to folders with corresponding names in a new window as to not overwrite the files?
Reply 1 of 1
December 16, 2010 2:18PM
You wouldn't get an app to do it. You might get an Automator workflow but a script is easier. Try the following Python script:
>print "specify input and output directory"
dirin = sys.argv
dirout = sys.argv
for root, dirs, files in os.walk(dirin):
>for f in files:
>>newfolder = dirout+"/"+f
>>print "making "+newfolder
>>os.system("mkdir '%s'" %(newfolder))
Paste that into a plain text document, change the > to tabs and save as filestofolders.py. Then open a terminal and type:
python <drag filestofolder.py here> <drag folder of files here> <drag output folder here>
Just drag the files and folders onto the terminal window in that order and hit return. It will tell you what it's doing. The mkdir command by default checks if a file or folder exists and won't overwrite.