Created
August 19, 2017 09:52
-
-
Save cquest/1c9b4c1916dcab54c1e3a57fe3f4df47 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
f = open(sys.argv[1],'r') | |
lines = f.readlines() | |
directory = ['','','','','','','',''] | |
prefix = '' | |
for l in lines[1:-2]: | |
n = l.lstrip() | |
level = (len(l)-len(n))/2 | |
i = n.split(' ') | |
if i[1]=='DIR': | |
directory[level] = i[0] | |
else: | |
if level>0: | |
print('mkdir -p hdd/%s ; ./ac.sh -g ../HDD.hdv %s hdd/%s' % ('/'.join(directory[0:level]), '/'+'/'.join(directory[0:level])+'/'+i[0], '/'.join(directory[0:level])+'/'+i[0])) | |
else: | |
print('./ac.sh -g ../HDD.hdv %s hdd/%s' % (i[0],i[0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment