Tag Archives: File
Get All Files in a Folder in Python
Posted by Shawn Zhang
on March 2, 2012
No comments
We may already knew that it is common to get all items in given folder via function provided by "OS" module .
file_foler = "Some_Path"
os.listdir(file_foler)
But ,os.listdir function will return folder and files in same time , what if we just want files in the folder ? There may be a solution that we loop over the result list and use os.path.isdir() to retrieve all files name
file_foler = "Some_Path"
result_list = []
for f in os.listdir(file_foler):
if os.path.isdir(os.path.join(file_folder,f)):
Read more [...]
Dive into VBA—File and Folder Operation
Posted by Shawn Zhang
on March 2, 2012
No comments
For language perspective, VBA is not the best language to perform file and folder operation, but it is easy to implement in VBA to fulfill the task. Otherwise , it is a bad design that involving two language to finish one mission , not only will increase the complexity of process but also not elegant solution .
Now, lets go through VBA function on File and Folder operation via three parts: Basic System Ops, Folder and File.
Basic System Operation
CurDir --Stands for “Current Directory”, Read more [...]