Created
October 23, 2018 19:37
-
-
Save SamKLowe/23c0174e4bec309f65dd76336f6843ec to your computer and use it in GitHub Desktop.
extract xilinx ise output script
This file contains 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
with open('compxlib.log.sam') as infile, open('compile.sh', 'w') as outfile: | |
copy = False | |
getNextLine = 0; | |
for line in infile: | |
copy = False | |
if line.startswith('Executing cmd') == 1: | |
copy = True | |
myTuple = line.partition('\''); | |
myString = myTuple[2] | |
myTuple = myString.partition('\''); | |
if line.endswith('-f\n'): | |
getNextLine = 1; | |
if myTuple[0].startswith('unzip') == 0: | |
outfile.write(myTuple[0].strip()) | |
if getNextLine == 0: | |
outfile.write('\n') | |
else: | |
if getNextLine == 1: | |
myTuple = line.partition('\''); | |
outfile.write(' '); | |
outfile.write(myTuple[0]) | |
outfile.write('\n') | |
getNextLine = 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment