<br><br><div class="gmail_quote">2011/6/10 B G <span dir="ltr"><<a href="mailto:compbiocancerresearcher@gmail.com">compbiocancerresearcher@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><div>path = "...\\Leukemia_Project"</div><div><div>i = 0</div><div>for (files) in os.walk(path):</div><div> print(files)</div><div> print("\n")</div><div> i += 1</div></div></blockquote><div>
<br>Continuing my thoughts:<br>I ran your loop, and got several tuples, each representing a directory. All the tuples have the same structure: 0th element is the name of the directory, followed by a list of subdirs (possibly empty) and a list of files (possibly empty). I find no reason to maipulate this by Excel. Try instead:<br>
<br><div>def clean(f):<br> any processing, removing here<br><br>path = ".../Leukemia_Project"<br>dirlists = []<br></div><div>for (files) in os.walk(path):<div> print(files)<br> dirlists.append(clean(files))<br>
</div><div> print("\n")</div><br></div>Then go on with next step. You will enjoy your work more than with printing-marking-copying-pasting-saving-opening-processing-saving-reopening...<br></div></div><br>