Skip to content

Instantly share code, notes, and snippets.

@cesarkawakami
Last active December 10, 2015 14:38
Show Gist options
  • Save cesarkawakami/4449433 to your computer and use it in GitHub Desktop.
Save cesarkawakami/4449433 to your computer and use it in GitHub Desktop.
with open("log.txt", "r") as f:
for line in f:
if re.match(r"^\d{2}-\w{3}", line):
date = line[:6]
continue
if date == "02-Jan":
if re.search("Error", line):
# something's wrong, better to call my creator!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment