Skip to content

Instantly share code, notes, and snippets.

@norbinsh
Created August 16, 2019 21:12
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 norbinsh/e56becfaef077df2790c48c9566507a4 to your computer and use it in GitHub Desktop.
Save norbinsh/e56becfaef077df2790c48c9566507a4 to your computer and use it in GitHub Desktop.
from collections import Counter
with open("x.txt", "r") as rf:
lines = rf.readlines()
Counter(list(map(lambda x: x.split("From ")[1].split(":")[0], list(filter(lambda x: x.startswith("From "), lines)))))
"""
From 05:20:34
From 05:20:34
From 05:20:34
From 05:20:34
From 05:20:35
From 05:20:35
From 05:20:35
From 05:20:35
From 05:20:35
From 05:20:35
From 07:29:35
From 07:29:35
From 07:29:35
From 07:29:35
From 07:29:35
From 07:29:35
From 07:29:35
From 09:30:22
10:05:05
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment