Tags: misc python scripting
Rating:
Zipped Up
```
#import Ziblib
import os
index = 0 #begin index which is dir 0
main = "./" # script directory
for j in range(0,5000): #i don't know how many files inside zip,can be use wile loope instead
prefix = "./" + str(index) + "/" # prefix = ./0/
filelist = os.listdir(prefix) # get file list in prefix ./0/
for i in filelist:
print "prefix:"+prefix
if "tar.bz2" in i: # start extract
os.system("bzip2 -dk "+prefix+i)
os.system("rm -rf "+prefix+i+"*.bz2")
if str(index+1) in os.listdir(main): # if directory name 1 (i) is exist in main dir ./ increase index 1
index = index + 1
if "tar" in i:
os.system("tar -xvf "+prefix+i)
if str(index+1) in os.listdir(main):
index = index + 1
if "kz3" in i:
os.system("unzip "+prefix+i)
if str(index+1) in os.listdir(main):
index = index + 1
if "tar.gz" in i:
os.system("tar -xzvf "+prefix+i)
if str(index+1) in os.listdir(main):
index = index + 1
```