Created
November 16, 2012 05:56
-
-
Save nrrb/4084590 to your computer and use it in GitHub Desktop.
counting unique timestamps in skype chatlogs
This file contains 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 csv | |
import os | |
import glob | |
src_path = 'C:\\Users\\Nick\\Dropbox\\MTS Relational Event Network Modeling\\MTS Data\\NU Newest Chatlogs\\Deduplicated Logs By Phase' | |
for filename in glob.glob(os.path.join(src_path, "*.txt")): | |
with open(filename, 'rb') as f: | |
rows = list(csv.reader(f, delimiter='\t')) | |
event_count = len(rows) | |
unique_timestamp_count = len(list(set([row[3] for row in rows if len(row) > 3]))) | |
print filename.split('\\')[-1], event_count, unique_timestamp_count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment