Created
October 11, 2015 20:41
-
-
Save rknLA/091d26331ee49110d410 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 re | |
matcher = re.compile('^inserted unique force: (\d*\.\d*)$') | |
with open('pasted_log_file.txt', 'r') as lf: | |
lines = lf.readlines() | |
forces = set() | |
for line in lines: | |
match = matcher.search(line) | |
if match: | |
groups = match.groups() | |
force = groups[0] | |
forces.add(float(force)) | |
sorted_forces = sorted(forces) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment