Copy nested files to flat directory





8
Date Submitted Tue. Mar. 21st, 2006 11:58 AM
Revision 1 of 1
Helper gbarendt
Tags File | programming | python | system
Comments 1 comments
Copies files from nested folders into one source, flat directory.

def CopyFlat(source, target):
    count = 0
    for root, dirs, files in os.walk(source):
        for file in files:
            count += 1
            name = os.path.join(root, file)
            shutil.copy(name, target)
 

Greg Barendt

Comments

Comments Thanks
Tue. Aug. 8th, 2006 7:50 AM    Scripter bertheymans

Voting