Last active
January 14, 2019 11:10
-
-
Save kieranjol/266157baf875bb4ad8130ffd393cdff3 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 | |
import os | |
source = sys.argv[1] | |
with open(source, 'r') as fo: | |
lines = fo.readlines() | |
for index, line in enumerate(lines): | |
if 'Source Checksums' in line: | |
if 'N/A' not in line: | |
checksum = line[-34:].rsplit()[0] | |
folder = lines[index +1 ].split()[-1].split('\\')[-2].replace('\n', '') | |
filename = lines[index +1 ].split()[-1].split('\\')[-1].replace('\n', '') | |
print '%s %s' % (checksum, os.path.join(folder, filename)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yup, twas line 11, i changed it from 32 to 34.