I have huge data in a directory tree format like:
c:/user/name/class/std/section I to VI [all section has individual folder i.e. 6 folder in total and all folder h
you can try this code :
import os
folder = 'C:'
for root, dirs, files in os.walk(folder):
for name in files:
print os.path.join(root, name)
for name in dirs:
print os.path.join(root, name)
UPDATE:
import os folder = 'C:'
for root, dirs, files in os.walk(folder):
for name in files:
nm, ext = os.path.splitext(name)
if ext == ".csv":
print os.path.join(root, name)