November 27th, 2004, 09:46 PM
need somebody to help me create a script
the thing is like this:
i have 90 folders, each one with a couple of files inside
i want a script that put all the files in one folder, but i want to add to each file the folder name to the file name.
for example i have "Adams, Douglas" folder with files "book 1" book 2" book 3"
and i want to get "Adams, Douglas - book 1" , "Adams, Douglas - book 2" "Adams, Douglas - book ..."
i dont know how to manage files with python so thats why i didnt made anything
thanks for your help
November 28th, 2004, 07:58 PM
December 5th, 2004, 12:55 AM
#you know there's nothing like a standard way of doing this, but I would create a script like the following (Recursive)
from dircache import listdir
Dir = Dir.replace("/","-")
f=open(Destination + Dir + Name,'wb')
DirVar = listdir(Dir)