Skip to content

Instantly share code, notes, and snippets.

@phobologic
Created October 8, 2014 19:46
Show Gist options
  • Save phobologic/c1ac9a29dd02a9946391 to your computer and use it in GitHub Desktop.
Save phobologic/c1ac9a29dd02a9946391 to your computer and use it in GitHub Desktop.
>>> string = """Namespace Queue Messages
... SJHENT Alert_Operation_Router 0
... SJHENT Alert_Process_Router 0
... SJHENT Alert_Service_Restart 0
... SJHENT Alert_Service_Router 0
... SJHENT BadMessageHandler 0
... SJHEDI EMailAlert 0
... SJHENTPMM Ens.Actor 0
... BLAHBLAH WOOTWOOT 501"""
>>> lines = string.split('\n')
>>> for line in lines:
... line = line.strip()
... if not line:
... continue
... parts = line.split()
... try:
... if int(parts[-1]) > 500:
... print line
... except ValueError:
... continue
...
BLAHBLAH WOOTWOOT 501
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment