0

Hi,

We need to zip files having '2009' in their names from a particular directory. How can we do the same.

Code:
file = zipfile.ZipFile("test.zip", "w")
os.chdir(rawFileLocation)
dirList = os.listdir(rawFileLocation)
for fnames in dirList:
file.write(fnames)
file.close()
It is zipping all the files. Please tell me the logic for adding files which fulfill certain criteria only.

Regards,

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by jlm699
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.