Skip to content

Instantly share code, notes, and snippets.

@kieranjol
Last active January 14, 2019 11:10
Show Gist options
  • Save kieranjol/266157baf875bb4ad8130ffd393cdff3 to your computer and use it in GitHub Desktop.
Save kieranjol/266157baf875bb4ad8130ffd393cdff3 to your computer and use it in GitHub Desktop.
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))
@kieranjol
Copy link
Author

Yup, twas line 11, i changed it from 32 to 34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment