Skip to content

Instantly share code, notes, and snippets.

@rknLA
Created October 11, 2015 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rknLA/091d26331ee49110d410 to your computer and use it in GitHub Desktop.
Save rknLA/091d26331ee49110d410 to your computer and use it in GitHub Desktop.
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